CSS样式(1)文本
单位
px:像素
em:1em–1个字符
2em–2个字符
%:百分比
颜色
颜色名:red,blue,green
RGB值:rgb(x,x,x)
每个颜色分量取值0-255
红色rgb(255,0,0)
灰色rgb(66,66,66)
RGB百分比值:rgb(x%,x%,x%)
0%-100%
红色:rgb(100%,0%,0%)
rgba(x,x,x,x):rgb值,透明度
#rrggbb:十六进制数
文本
color:文本颜色 red #foo
rgb(255,0,0)
letter-height:字符间距 2px -3px
line-height:行高 14px 1.5em 120%
text-align:对齐 center left right justify
text-decoration:装饰线 none overline underline line-through
text-indent:首行缩进 2em
字符间距
<style>
h1{
letter-spacing:2px;
}
h2{
letter-spacing:-3px;
}
</style>
html部分
<body>
<h1>标题内容</h1>
<h2>文本段落主要内容</h2>
</body>
行高
p{font-size:14px;
line-height:2em;
}
或者
/*line-height:40px;*/