border-block-style
The border-block-style
CSS property defines the style of the logical block borders of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-style
and border-bottom-style
, or border-left-style
and border-right-style
properties depending on the values defined for writing-mode
, direction
, and text-orientation
.
尝试一下
The border style in the other dimension can be set with border-inline-style
, which sets border-inline-start-style
, and border-inline-end-style
.
语法
css
/* <'border-style'> values */
border-block-style: dashed;
border-block-style: dotted;
border-block-style: groove;
/* Global values */
border-block-style: inherit;
border-block-style: initial;
border-block-style: revert;
border-block-style: revert-layer;
border-block-style: unset;
值
<'border-style'>
-
边框的线型。请参见
border-style
.
正式定义
正式语法
示例
带有垂直文本的虚线边框
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-block-style: dashed;
}
结果
规范
规范 |
---|
CSS 逻辑属性和值级别 1 # propdef-border-block-style |
浏览器兼容性
BCD 表格仅在浏览器中加载
另请参阅
- CSS 逻辑属性和值
- 此属性映射到物理边框属性之一:
border-top-style
,border-right-style
,border-bottom-style
, orborder-left-style
. writing-mode
,direction
,text-orientation