CSS font-weight 屬性


實例

三段文字設置不同的字體粗細:

p.normal {font-weight:normal;}
p.thick {font-weight:bold;}
p.thicker {font-weight:900;}


屬性定義及使用說明

font-weight 屬性設置文本的粗細

默認值: normal
繼承: yes
版本: CSS1
JavaScript 語法: object.style.fontWeight="900"


流覽器支持

表格中的數字表示支持該屬性的第一個流覽器版本號。

屬性
font-weight 2.0 4.0 1.0 1.3 3.5

屬性值

描述
normal 默認值。定義標準的字元。
bold 定義粗體字元。
bolder 定義更粗的字元。
lighter 定義更細的字元。
  • 100
  • 200
  • 300
  • 400
  • 500
  • 600
  • 700
  • 800
  • 900
定義由粗到細的字元。400 等同於 normal,而 700 等同於 bold。
inherit 規定應該從父元素繼承字體的粗細。


相關文章

CSS 教學: CSS Font

CSS 參考手冊: font 屬性