CSS文本属性。

设置文本颜色:

body {color:red}
h1 {color:#00ff00}
p.ex {color:rgb(0,0,255)}

设置背景颜色:

h1{background-color: yellow;}

设置字符间距:

h1 {letter-spacing: -0.5em}
h4 {letter-spacing: 20px}

 设置行间距:

三种设置行间距的 百分比 像素 数值。

p.big {line-height: 200%}   {!--设置行间距,一般行间距110%~120%--}
p.big {line-height: 20px} 
p.big {line-height: 3} 

对齐文本:

h1{text-align: center;}        中间对齐
h1{text-align: lift;}             左对齐
h1{text-align: right;}          右对齐

给文本加划线:

h1{text-decoration:overline;}           上划线
h2 {text-decoration: line-through}    划线
h3 {text-decoration: underline}         下划线
原文地址:https://www.cnblogs.com/lovesoda/p/9401837.html