border-inline-end-style

Baseline 已廣泛支援

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2020 年 1 月⁩ 起,所有主流瀏覽器均已支援。

border-inline-end-style CSS 屬性定義了元素的邏輯行尾邊框的樣式,該樣式根據元素的書寫模式、方向性和文字方向對映到物理邊框樣式。它對應於 border-top-styleborder-right-styleborder-bottom-styleborder-left-style 屬性,具體取決於為 writing-modedirectiontext-orientation 定義的值。

試一試

border-inline-end-style: dotted;
writing-mode: horizontal-tb;
border-inline-end-style: dotted;
writing-mode: vertical-rl;
border-inline-end-style: groove;
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: #eeeeee;
  color: black;
  border: 0.75em solid;
  padding: 0.75em;
  width: 80%;
  height: 100px;
  unicode-bidi: bidi-override;
}

語法

css
/* <'border-style'> values */
border-inline-end-style: dashed;
border-inline-end-style: dotted;
border-inline-end-style: groove;

/* Global values */
border-inline-end-style: inherit;
border-inline-end-style: initial;
border-inline-end-style: revert;
border-inline-end-style: revert-layer;
border-inline-end-style: unset;

相關屬性包括 border-block-start-styleborder-block-end-styleborder-inline-start-style,它們定義了元素其他邊框的樣式。

<'border-style'>

邊框的線條樣式。請參閱 border-style

正式定義

初始值none
應用於所有元素
繼承性
計算值同指定值
動畫型別離散

正式語法

border-inline-end-style = 
<line-style>

<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-lr;
  border: 5px solid blue;
  border-inline-end-style: dashed;
}

結果

規範

規範
CSS 邏輯屬性和值第 1 級
# border-style

瀏覽器相容性

另見