border-inline

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.

border-inlineCSS のプロパティで、論理的なインライン方向のそれぞれの境界プロパティをスタイルシートの 1 ヶ所で設定する一括指定プロパティです。

試してみましょう

border-inline の割り当て先の物理的な境界は、要素の書字方向によって決まります。 border-topborder-bottom、または border-rightborder-left のどちらかの組み合わせに対して、 writing-modedirectiontext-orientation に設定された値に応じて対応づけられます。

他の方向の境界については、 border-block によって、 border-block-startborder-block-end の両方を設定することができます。

構成要素のプロパティ

このプロパティは下記の CSS プロパティの一括指定です。

構文

css
border-inline: 1px;
border-inline: 2px dotted;
border-inline: medium dashed blue;

/* グローバル値 */
border-inline: inherit;
border-inline: initial;
border-inline: revert;
border-inline: unset;

border-inline は以下の値のうちの1つ以上を任意の順序で指定します。

<'border-width'>

境界の幅です。 border-width を参照してください。

<'border-style'>

境界線のスタイルです。 border-style を参照してください。

<'color'>

境界の色です。 color を参照してください。

公式定義

初期値一括指定の次の各プロパティとして
適用対象すべての要素
継承なし
計算値一括指定の次の各プロパティとして
アニメーションの種類一括指定の次の各プロパティとして

形式文法

border-inline = 
<'border-block-start'>

<border-block-start> =
<line-width> ||
<line-style> ||
<color>

<line-width> =
<length [0,∞]> |
thin |
medium |
thick

<line-style> =
none |
hidden |
dotted |
dashed |
solid |
double |
groove |
ridge |
inset |
outset

テキストが垂直の場合の境界

HTML

html
<div>
  <p class="exampleText">Example text</p>
</div>

CSS

css
div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}

.exampleText {
  writing-mode: vertical-rl;
  border-inline: 5px dashed blue;
}

結果

仕様書

Specification
CSS Logical Properties and Values Level 1
# propdef-border-inline

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
border-inline

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報