border-inline-style
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2021年4月.
CSS 属性 border-inline-style 定义了元素的逻辑行向的边框线型,并根据元素的书写模式、行内方向和文本朝向对应至实体边框线型。根据 writing-mode、direction 和 text-orientation 所定义的值,此属性对应于 border-top-style 和 border-bottom-style,或者 border-left-style 和 border-right-style 属性。
尝试一下
border-inline-style: dotted; writing-mode: horizontal-tb; border-inline-style: dotted; writing-mode: vertical-rl; border-inline-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: #eee; color: #000; border: 0.75em solid; padding: 0.75em; width: 80%; height: 100px; unicode-bidi: bidi-override; } 另一方向的边框线型可用 border-block-style 设置,此属性会设置 border-block-start-style 和 border-block-end-style。
语法
css
/* 边框线型值 */ border-inline-style: dashed; border-inline-style: dotted; border-inline-style: groove; /* 全局值 */ border-inline-style: inherit; border-inline-style: initial; border-inline-style: revert; border-inline-style: revert-layer; border-inline-style: unset; 取值
<'border-style'>-
边框线型。见
border-style。
形式定义
形式语法
border-inline-style =
<'border-top-style'>{1,2}
<border-top-style> =
<line-style>
<line-style> =
none |
hidden |
dotted |
dashed |
solid |
double |
groove |
ridge |
inset |
outset
示例
>设置 border-inline-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-inline-style: dashed; } 规范
| Specification |
|---|
| CSS Logical Properties and Values Level 1> # propdef-border-inline-style> |