The border-block
は CSS のプロパティで、論理的なブロック方向のそれぞれの境界プロパティをスタイルシートの1ヶ所で設定する一括指定プロパティです。
border-block: 1px;
border-block: 2px dotted;
border-block: medium dashed blue;
border-block
は border-block-width
, border-block-style
, border-block-color
のうちの1つ以上の値を、インライン方向の先頭側と末尾側の両方に対して一度に設定するために使用することができます。割り当て先の物理的な境界は、要素の書字方向によって決まります。 border-top
と border-bottom
、または border-right
と border-left
のどちらかの組み合わせに対して、 writing-mode
, direction
, text-orientation
に設定された値に応じて対応付けられます。
他の方向の境界については、 border-inline
によって、 border-inline-start
と border-inline-end
の両方を設定することができます。
初期値 | 一括指定の各プロパティとして
|
---|---|
適用対象 | すべての要素 |
継承 | なし |
計算値 | 一括指定の各プロパティとして
|
アニメーションの種類 | 個別 |
構文
値
border-block
は以下の値のうちの1つ以上を任意の順序で指定します。
<'border-width'>
- 境界の幅です。
border-width
を参照してください。 <'border-style'>
- 境界線のスタイルです。
border-style
を参照してください。 <'color'>
- 境界の色です。
color
を参照してください。
形式文法
<'border-top-width'> || <'border-top-style'> || <'color'>where
<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>
where
<rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )
<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )
<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )
<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where
<alpha-value> = <number> | <percentage>
<hue> = <number> | <angle>
例
HTML
<div>
<p class="exampleText">Example text</p>
</div>
CSS
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-rl;
border-block: 5px dashed blue;
}
仕様書
仕様書 | 状態 | 備考 |
---|---|---|
CSS Logical Properties and Values Level 1 border-block の定義 |
編集者草案 | 初回定義 |
ブラウザーの互換性
BCD tables only load in the browser
関連情報
- このプロパティは物理的な境界プロパティである
border-top
,border-right
,border-bottom
,border-left
の何れかに対応付けられます。 writing-mode
,direction
,text-orientation