一、伪类选择器
使用伪类选择器,我们可以以不同方式格式化超级链接<a>元素的四种不同状态:
1)a:link是用在未访问的链接的选择器
2)a:visited是用在已访问过的链接的选择器
3)a:hover是用在鼠标光标放在其上的链接的选择器
4)a:active是用在获得焦点(比如,被点击)的链接上的选择器
二、设置元素内容的字体
1.设置字体名称:font-family
2.设置字体的倾斜程度:font-style
3.设置字体的变体:fone-variant
4.设置字重:font-weight
5.设置字体大小:font-size
6.字体属性的缩写形式:font是以上属性的快捷方式,属性顺序应该按照font-style、shefont-variant、font-weight、font-size、font-family排列。
三、设置元素内容的文本属性
1.设置文本首行缩进:text-indent 可选属性值包括<length>|<percentage>
2.设置文本对齐方式:text-align 可选属性包括:left|right|center
3.设置文本修饰方式:text-decoration line可选属性值包括:neno|[underline||overline|line-through||blink|].属性值含义分别为:underline下划线、overline上划线、line-through删除线、blink闪烁。
4.设置文本阴影特效:text-shadow 可选属性值包括:none|<color>[,<color>]*.
5.设置行高:line-height属性设置元素的行高。它可以使数字(字体大小的倍数)、长度、百分比或normal。
6.设置字间距:letter-spacing 可选属性值包括:normal|<length>|auto.
7.设置词间距:Word-spacing 可选属性值包括normal|<length>.
8.设置文本大小写形式:可选属性值包括capitalize|uppercase|lowercase|none。
9.设置空白显示形式:White-space 可选属性包括:normal|pre|nowrap