border-inline-end-width

CSS 属性 border-inline-end-width 定义了元素的逻辑行末的边框宽度,并根据元素的书写模式、行内方向和文本朝向对应至实体边框宽度。根据 writing-modedirectiontext-orientation 所定义的值,此属性对应于 border-top-widthborder-right-widthborder-bottom-widthborder-left-width 属性。

尝试一下

语法

/* 边框宽度值 */
border-inline-end-width: 2px;
border-inline-end-width: thick;

/* 全局值 */
border-inline-end-width: inherit;
border-inline-end-width: initial;
border-inline-end-width: revert;
border-inline-end-width: revert-layer;
border-inline-end-width: unset;

与此相关的属性有 border-block-start-widthborder-block-end-widthborder-inline-start-width,这些属性定义了元素其他边框的宽度。

取值

<'border-width'>

边框宽度。见 border-width

形式定义

初始值medium
适用元素all elements
是否是继承属性
Percentageslogical-width of containing block
计算值absolute length; 0 if the border style is none or hidden
Animation typeby computed value type

形式语法

border-inline-end-width = 
<'border-top-width'>

示例

为竖排文本应用边框

HTML

<div>
  <p class="exampleText">示例文本</p>
</div>

CSS

div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}

.exampleText {
  writing-mode: vertical-lr;
  border: 1px solid blue;
  border-inline-end-width: 5px;
}

结果

规范

Specification
CSS Logical Properties and Values Level 1
# border-width

浏览器兼容性

BCD tables only load in the browser

参见