个数 | 属性 | 描述 | 说明 |
1 | font-size | 字体大小 | 单位是px,浏览器默认是16px,设计图常用字号是12px |
2 | font-family | 字体 | 当字体是中文字体、英文字体中有空格时,需加双引号;多个字体中间用逗号链接,先解析第一个字体,如果没有解析第二个字体,以此类推。 |
3 | color | 颜色 | color:red; color:#ff0; color:rgb(255.0.0); 0-255 |
4 | font-weight | 加粗 | font-weight:bolder(更粗的)/bold(加粗)/normal(常规) font-weight:100-900;100-500不加粗 600-900加粗 |
5 | font-style | 倾斜 | font-style:italic(斜体字)/oblique(倾斜的文字)/normal(常规显示); |
6 | text-aligin | 文本水平对齐 | text-aligin:left/right/center/justify(水平两端对齐,但是只对多行起作用) |
7 | line-height | 行高 | line-height的数据=height的数据,可以实现单行文本垂直居中 |
8 | text-indent | 首行缩进 | text-indent可以取负值; text-indent属性只对第一行起作用 |
9 | letter-spacing | 字间距 | 控制文字和文字之间的间距 |
10 | text-decoration | 文本修饰 | text-decoration:none没有/underline下划线/overline上划线/line-through删除线 |
11 | font | 文字简写 | font是font-style font-weight font-size / line-height font-family 的简写。 font:italic 800 30px/80px "宋体";顺序不能改变 ,必须同时指定font-size和font-family属性时才起作用 |
补充
1.字体