CSS3 (五) 字体

基本字体属性

字体:‘font-family’属性


示例:
body { 
    font-family: Helvetica, Verdana, sans-serif; 
}

如果Helvetica有效,则在渲染时使用该字体家族。如果Helvetica和Verdana均不可用,则将使用用户地理定义的无衬线字体(sans serif)字体。

字体粗细:‘font-weight’属性 取值范围

normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

字体宽度:‘font-stretch’属性


其从窄至宽拥有下列顺序:

  • Ultra Condensed
  • Extra Condensed
  • Condensed
  • Semi Condensed
  • Normal
  • Semi Expanded
  • Expanded
  • Extra Expanded
  • Ultra Expanded



字体样式:‘font-style’属性



取值: normal | italic | oblique



字体大小:‘font-size’属性


示例

p { font-size: 12pt; }
blockquote { font-size: larger }
em { font-size: 150% }
em { font-size: 1.5em }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章