常用文本样式
| 样式 | 值 | 作用 |
|---|---|---|
| font-size | 数字 | 设置字体大小 |
| font-weight | normal(默认)| bold(粗体)| bolder(更粗)| lighter(更细)| inherit(从父元素继承) | 设置文字是否加粗 |
| font-style | normal(默认)| italic(斜体)| oblique(倾斜)| inherit(从父元素继承) | 设置文字是否为斜体 |
| font-family | 字体名称 | 设置文字显示的字体名称 |
| text-align | left(左)| center(居中)| right(右)| justify(两端) | 水平对齐方式 |
| text-indent | 长度 ((2em)首行2缩进)) | 设置文本缩进 |
| line-height | normal | 长度 (%/像素/数字) | 设置行高 |
| text-decoration | none(默认)| blink(闪烁)| underline(下划线)| line-through(穿过文本,如删除线)| overline(上划线) | 设置文本装饰 |
| vertical-align | top | middle | bottom | sub | super | baseline | 垂直对齐方式 |
| 值 | 描述 |
|---|---|
| top | 把元素的顶端与行中最高元素的顶端对齐 |
| middle | 把此元素放置在父元素的中部。 |
| bottom | 把元素的顶端与行中最低的元素的顶端对齐。 |
| sub | 垂直对齐文本的下标。 |
| super | 垂直对齐文本的上标 |
| baseline | 默认。元素放置在父元素的基线上。 |
| text-top | 把元素的顶端与父元素字体的顶端对齐 |
| text-bottom | 把元素的底端与父元素字体的底端对齐。 |
| length | |
| % | 使用 “line-height” 属性的百分比值来排列此元素。允许使用负值。 |
| inherit | 规定应该从父元素继承 vertical-align 属性的值。 |
