文本样式 (比较多的字)
1 text-align 文本的水平对齐方式
text-align:left; 左对齐
text-align:right; 右对齐
text-align:center; 居中对齐
text-align:justify; 两端对齐 (用于多行文本)
可以写给所有文字的所有标签
1、如何设置单行文本的水平垂直居中
text-align: center;
line-height: 高高度一样;
2、如果让图片水平居中,给*父元素*添加 text-align:center
2 text-indent 文本首行缩进
text-indent: 2em;
px 绝对单位 固定单位
em单位 相对单位 可以改变(根据font-size的值自动改变)
比如 font-size:20px; 1em = 20px 2em=40px
font-size:22px;1em = 22px 2em=44px
可以写给所有文字的所有标签 (单行文本也可以缩进)
3 文本装饰 text-decoration
text-decoration: none; 去掉文本装饰(一般用于a标签)
text-decoration: underline; 下划线
text-decoration: overline; 上划线
text-decoration: line-through; 中划线
如何设置线条的类型
text-decoration: 2px overline wavy;
线宽 线的位置 线的类型
线条类型有 solid 实线
dotted 点状线
dashed 虚线
double 双实线
wavy 波浪线
4 文字和文字之间的间距 letter-spacing
letter-spacing:15px; 15px 指的是字和字之间的距离
5 单词和单词之间的间距 word-spacing
word-spacing: 30px;