一、font-size 文字大小 浏览器
(浏览器默认大小通常是16px)
二、font-family 字体 字体
(先写英文字体,在写中文字体)
如:spa
font-family: "方正细体", "楷体", "微软雅黑", "宋体"; font-family: Arial, "楷体", "微软雅黑", "宋体";
三、font-style 斜体code
italic 倾斜/normal 正常orm
四、font-weight 加粗blog
bold 加粗/normal 正常/numberci
五、line-height 行高 it
文字在一行中上下居中 io
单位:px或者当前元素字体大小的倍数
line-height的值紧跟着font-size值使用斜杠分开,class
如:<font-size>/<line-height>
line-height: 1.4; font: 18px/2 "宋体";
font (集合样式)
1. 固定顺序 (font-weight font-style font-size/line-height font-family)
2. 必写项 (font-size font-family)
六、color 文字颜色
如:
font: 18px/2 "宋体"; color: red;
七、 text-indent 首行缩进
正值 从左向右移动首行文字
负值 从右向左移动首行文字
单位 em 1em = 当前元素的1个文字大小
八、text-align
文本对齐方式(left/center/right)
九、text-decoration
文本修饰
(none/underline下划线/overline上划线/line-through删除线)
十、
word-spacing 单词间距
letter-spacing 字母间距
如:
word-spacing:2px;
letter-spacing: 3px;
十一、win7中 宋体 下 英文特殊字符的宽度(如空格),是字体大小的一半
宋体中,文字右边通常会保留1px的空隙
两个词中间的距离 = word-spacing + 2*letter-spacing + 空格;