css3 字体自动换行第二行缩进一格

html-css09

css3 字体自动换行第二行缩进一格,第1张

p {

text-indent: -2em

margin-left: 2em

}

设置text-indent: -2em以后p标签中第一行文字向左偏移,这样第二行开始的文字就等于缩进了,但是这样设置会导致第一行向左超出div,所以再用margin-left使p标签整体右移即可

我个人项目里面比较常用的:

font-size 文字大小(一般均为偶数)

font-family 字体(中文默认宋体)

color文字颜色(英文、rgb、十六位进制色彩值)

text-align文本对齐方式

line-height 行高[垂直居中]

text-indent 首行缩进(em缩进字符)

font-weight文字着重(加粗字体)

font-style文字倾斜

text-decoration 文本修饰

letter-spacing 字母(文字)间距

word-spacing 单词间距(以空格为解析单位)