CSSfont -weightプロパティ
例
3つの段落に異なるフォントの太さを設定します。
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
定義と使用法
このfont-weight
プロパティは、テキスト内の太い文字または細い文字を表示する方法を設定します。
デフォルト値: | 正常 |
---|---|
遺伝性の: | はい |
アニメート可能: | はい。アニメート可能について読む |
バージョン: | CSS1 |
JavaScript構文: | オブジェクト.style.fontWeight = "bold" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
CSS構文
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
normal | Defines normal characters. This is default | |
bold | Defines thick characters | |
bolder | Defines thicker characters | |
lighter | Defines lighter characters | |
100 200 300 400 500 600 700 800 900 |
Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSチュートリアル:CSSフォント
CSSリファレンス:フォントプロパティ
HTML DOMリファレンス:fontWeightプロパティ