基础属性
字体相关属性

属性 | 含义 | 取值 |
---|
Font -family | 字体体系 | 字体名称,宋体 |
font-size | 字体大小 | |
font-style | 是否倾斜 | Normal/italic |
font-variant | 是否大写 | Normal/small-caps |
font-weight | 字体粗细 | Normal/bold/bolder/lighter |
可以简写、书写顺序
font-style font-variant font-weight font-size
font-family
前三个可以省略,使用默认值 font-size font-family必须指定值
文本相关属性

文本颜色:color
文本装饰:text-decoration
文本方向:direction
文本对齐:text-align
大小写:text-transform
首行缩进:text-indent
字母间距:letter-spacing
单词间距:word-spacing
行高:line-height
背景相关属性

背景颜色:background-color
背景图片:background-image:设置图片url地址
图片重复:background-repeat
repeat:在水平和垂直方向重复
repeat-x:在水平方向重复
repeat-y:在垂直方向重复
背景位置:background-position
简写方式:背景色 背景图片 重复方式 位置
尺寸相关属性
高度:height
宽度:width
最大宽度|最小宽度 max-width|min-width
最大高度|最小高度 max-height|min-height
显示相关属性
visibility:hidden;仅仅隐藏内容,该元素所占位置还在
display:none;不仅仅隐藏内容,还不占位置

display可以设置元素显示模式
block:转块级元素
inline:将块级元素以行内元素显示,此时不能设置宽高
inline-block:将块级元素以行内元素显示,同时兼具块级元素
的某些特征,可以使用宽 高设置大小