CSSborder -top-widthプロパティ
例
上部の境界線の幅を設定します。
div {border-top-width: thin;}
以下の「自分で試してみてください」の例をもっと見てください。
定義と使用法
このborder-top-width
プロパティは、要素の上部の境界線の幅を設定します。
注:プロパティの前に、常にborder-styleまたは
border-top-styleプロパティを宣言してくださいborder-top-width
。幅を変更する前に、要素に境界線が必要です。
デフォルト値: | 中くらい |
---|---|
遺伝性の: | いいえ |
アニメート可能: | はい。アニメート可能について読む |
バージョン: | CSS1 |
JavaScript構文: | object .style.borderTopWidth = "5px" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
border-top-width | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS構文
border-top-width: medium|thin|thick|length|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
medium | Specifies a medium top border. This is default | |
thin | Specifies a thin top border | |
thick | Specifies a thick top border | |
length | Allows you to define the thickness of the top border. Read about length units | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
その他の例
例
上枠の幅を中程度に設定します。
div {border-top-width: medium;}
例
上枠の幅を太く設定します。
div {border-top-width: thick;}
例
上部の境界線の幅を1pxに設定します。
div {border-top-width: 1px;}
例
上部の境界線の幅を15pxに設定します。
div {border-top-width: 15px;}
関連ページ
CSSチュートリアル:CSS Border
CSSリファレンス:border-topプロパティ
HTML DOMリファレンス: borderTopWidthプロパティ