目录
1.CSS文本属性
(1)color:文本颜色,通常采用16进制,而且是简写模式,比如#fff
(2)text-align:文本对齐。center,left,top,设定文字水平的对齐方式
(3)text-indent:文字缩进。通常取值为2em,
(4)text-decoration:文本修饰,有上划线,下划线,删除线
div {
text-decoration: none;
}
none:默认,没有装饰线(最常用)
underline:下划线,链接a自带下划线(常用)
overline:上划线(几乎不用)
line-through:删除线(不常用)
(5)行间距:设置行间的距离(行高),可控制文字行与行之间的距离
p {
line-height: 26px;
}
2. CSS背景属性:
(1)background-color:背景颜色,颜色值/十六进制/RGB代码
(2)background-image:背景图片,url(图片路径)
(3)background-repeat:是否平铺,repeat/no-repeat/repeat-x/repeat-y
(4)background-position:背景位置,length/position,分别是x和y坐标
(5)background-attachment:背景附着,scroll(背景滚动)/fixed(背景固定)
(6)背景简写:背景颜色 背景图片地址 背景平铺 背景滚动 背景位置
(7)背景色半透明:background:rgba(0,0,0,0.3);后面必须是4个值
3.CSS盒子
(1)边框
border:边框
border-top
border-bottom
border-left
border-right