CSS字体属性和文本属性

选择器权重:
内联样式>id选择器>类选择器>元素选择器
1000>100>10>1 永不进位
继承来的属性,他的权重非常低,接近于0

!important,可以破坏选择器权重,强行让对应的属性权重最高

字体属性:font-family,font-size,font-style,font-weight
font-size:谷歌浏览器默认的字体大小是16px;

font-style:normal 表示默认的,italic表示斜体的
font-weight:工作中常用100-900来表示,400表示normal;

文本属性:text-decoration,text-indent,line-height,letter-spacing,word-spacing,text-align
text-decoration:underline表示下划线,overline表示上划线,line-through表示穿过线
text-indent:2em,表示段落缩进两格
line-height:60px 表示行高,行与行之间的距离
letter-spacing:20px 表示文字和文字之间的距离(仅对中文有效)
word-spacing:20px 表示文字和文字之间的距离(仅对英文有效)
text-align:center,right,left;其中center在实战中用的最多,left是默认的

posted @ 2020-01-27 13:17  我爱喝酸奶  阅读(199)  评论(0编辑  收藏  举报