border-block-start-style
border-block-start-style
CSS 属性定义了一个元素的逻辑块开始边框的样式,该样式根据元素的书写模式、方向性和文本方向映射到物理边框样式。它对应于 border-top-style
、border-right-style
、border-bottom-style
或 border-left-style
属性,具体取决于为 writing-mode
、direction
和 text-orientation
定义的值。
试一试
border-block-start-style: dotted;
writing-mode: horizontal-tb;
border-block-start-style: dotted;
writing-mode: vertical-rl;
border-block-start-style: groove;
writing-mode: horizontal-tb;
border-block-start-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: #eeeeee;
color: black;
border: 0.75em solid;
padding: 0.75em;
width: 80%;
height: 100px;
unicode-bidi: bidi-override;
}
语法
css
/* <'border-style'> values */
border-block-start-style: dashed;
border-block-start-style: dotted;
border-block-start-style: groove;
/* Global values */
border-block-start-style: inherit;
border-block-start-style: initial;
border-block-start-style: revert;
border-block-start-style: revert-layer;
border-block-start-style: unset;
相关属性包括 border-block-end-style
、border-inline-start-style
和 border-inline-end-style
,它们定义了元素的其他边框样式。
值
<'border-style'>
-
边框的线条样式。请参阅
border-style
。
正式定义
正式语法
border-block-start-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-block-start-style: dashed;
}
结果
规范
规范 |
---|
CSS 逻辑属性和值第 1 级 # border-style |
浏览器兼容性
加载中…