border-inline-color
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
Please take two minutes to fill out our short survey.
border-inline-start-color
は CSS のプロパティで、要素の論理的なインライン方向の先頭側の境界色を定義し、それが要素の書字方向やテキストの方向に応じて物理的な境界色に対応づけられます。これは border-top-color
と border-bottom-color
、または border-right-color
と border-left-color
の組み合わせのどちらかに対応し、どちらに対応するかは writing-mode
、direction
、text-orientation
で定義された値によって決まります。
試してみましょう
border-inline-color: red;
writing-mode: horizontal-tb;
border-inline-color: #32a1ce;
writing-mode: vertical-rl;
border-inline-color: rgb(170, 50, 220, 0.6);
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: #000;
border: 0.75em solid;
padding: 0.75em;
width: 80%;
height: 100px;
unicode-bidi: bidi-override;
}
他の方向の境界色については、 border-block-color
によって border-block-start-color
と border-block-end-color
を設定することができます。
構文
css
border-inline-color: yellow;
border-inline-color: #f5f6f7;
/* グローバル値 */
border-inline-color: inherit;
border-inline-color: initial;
border-inline-color: revert;
border-inline-color: unset;
値
公式定義
初期値 | currentcolor |
---|---|
適用対象 | すべての要素 |
継承 | なし |
計算値 | 色の計算値 |
アニメーションの種類 | 計算値の型による |
形式文法
例
テキストが垂直方向の場合の境界色
HTML
html
<div>
<p class="exampleText">Example text</p>
</div>
CSS
css
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-inline-color: red;
}
結果
仕様書
Specification |
---|
CSS Logical Properties and Values Level 1 # propdef-border-inline-color |
ブラウザーの互換性
関連情報
- このプロパティは
border-top-color
、border-right-color
、border-bottom-color
、border-left-color
のうちの 1 つに対応します writing-mode
、direction
、text-orientation
+ bug 1297097