border-inline-style

**border-inline-style** CSS 属性定义元素的逻辑内联边框的样式,它映射到物理边框样式,具体取决于元素的书写模式、方向和文本方向。它对应于 border-top-styleborder-bottom-style,或 border-left-styleborder-right-style 属性,具体取决于为 writing-modedirectiontext-orientation 定义的值。

试一试

另一个维度的边框样式可以使用 border-block-style 设置,它会设置 border-block-start-styleborder-block-end-style

语法

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

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

Values

<'border-style'>

边框的线型。参见 border-style

正式定义

Initial valuenone
Applies to所有元素
Inheritedno
Computed valueas specified
Animation typediscrete

正式语法

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">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-style: dashed;
}

规范

Specification
CSS Logical Properties and Values Level 1
# propdef-border-inline-style

浏览器兼容性

BCD 表格仅在浏览器中加载

另请参阅