border-block-end-style
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.
Please take two minutes to fill out our short survey.
CSS 属性 border-block-end-style
定义了元素的逻辑块末的边框线型,并根据元素的书写模式、行内方向和文本朝向对应至实体边框线型。根据 writing-mode
、direction
和 text-orientation
所定义的值,此属性对应于 border-top-style
、border-right-style
、border-bottom-style
或 border-left-style
属性。
尝试一下
border-block-end-style: dotted;
writing-mode: horizontal-tb;
border-block-end-style: dotted;
writing-mode: vertical-rl;
border-block-end-style: groove;
writing-mode: horizontal-tb;
border-block-end-style: dashed;
writing-mode: vertical-lr;
<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;
}
语法
css
/* 边框线型值 */
border-block-end-style: dashed;
border-block-end-style: dotted;
border-block-end-style: groove;
/* 全局值 */
border-block-end-style: inherit;
border-block-end-style: initial;
border-block-end-style: revert;
border-block-end-style: revert-layer;
border-block-end-style: unset;
与此相关的属性有 border-block-start-style
、border-inline-start-style
和 border-inline-end-style
,这些属性定义了元素其他边框的线型。
取值
<'border-style'>
-
边框线型。见
border-style
。
形式定义
形式语法
示例
竖排文本的虚线边框
HTML
html
<div>
<p class="exampleText">示例文本</p>
</div>
CSS
css
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
border: 5px solid blue;
border-block-end-style: dashed;
}
结果
规范
Specification |
---|
CSS Logical Properties and Values Level 1 # border-style |