一.字体样式
- 字体系列
font-family: 'Times New Roman', Times, serif;
注意: 如果字体系列名中有汉字、多个单词,要加引号,但是如果只有一个单词加引号也不错,干脆给所有的字体系列名称都加引号(英文的引号---单引号、双引号)
- 字体大小
fong-size:12px
注意:
1)浏览器默认字体大小是16px(标题标签除外 h1-h6 )
2)浏览器默认的最小字体是12px
3.字体粗细
font-weight: 400;
注意:
100 细
400 正常
700 粗
一定是整百的数字
4.字体风格
div{
font-style: italic;//倾斜
}
em{
font-style: normal;// 正常
}
二.文本样式
- 文本颜色
color:red;
固定单词:red、blue、pink
十六进制:#ff0000
总共有6个数字,前两个表示红色,中间两个表示绿色,后面两个表示蓝色
rgb(200,100,150)
- 文本对齐
text-align: center;//left//right
3.文本装饰
a {
text-decoration: none;
}
ins{
text-decoration: underline;
}
del{
text-decoration: line-through;//中划线
}
text-decoration: overline;//上划线
- 文本首行缩进
text-indent 20px向右缩进20像素
text-indent -20px向左缩进20像素
text-indent 2em向右缩进2个字体大小
-
文本行间距(行高)
line-height 一行文本占据的高度
单行文本垂直居中:设置行高等于高度