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: solid;
writing-mode: horizontal-tb;
border-inline: dashed red;
writing-mode: vertical-rl;
border-inline: 1rem solid;
writing-mode: horizontal-tb;
direction: rtl;
<section class="default-example" id="default-example">
  <div class="transition-all" id="example-element">
    This is a box with a border around it.
  </div>
</section>
#example-element {
  background-color: #eee;
  color: #8b008b;
  padding: 0.75em;
  width: 80%;
  height: 100px;
  unicode-bidi: bidi-override;
}

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

ブラウザーの互換性

関連情報