此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
border-inline-width
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-width 定义了元素的逻辑行向的边框宽度,并根据元素的书写模式、行内方向和文本朝向对应至实体边框宽度。根据writing-mode、direction 和text-orientation 所定义的值,此属性对应于border-top-width 和border-bottom-width,或者border-left-width 和border-right-width 属性。
In this article
尝试一下
border-inline-width: thick;writing-mode: horizontal-tb;border-inline-width: thick;writing-mode: vertical-rl;border-inline-width: 4px;writing-mode: horizontal-tb;direction: rtl;<section> <div> This is a box with a border around it. </div></section>#example-element { background-color: palegreen; color: #000; border: 0 solid crimson; padding: 0.75em; width: 80%; height: 100px; unicode-bidi: bidi-override;}另一方向的边框宽度可用border-block-width 设置,此属性会设置border-block-start-width 和border-block-end-width。
语法
css
/* 边框宽度值 */border-inline-width: 5px 10px;border-inline-width: 5px;border-inline-width: thick;/* 全局值 */border-inline-width: inherit;border-inline-width: initial;border-inline-width: revert;border-inline-width: revert-layer;border-inline-width: unset;取值
<'border-width'>边框宽度。见
border-width。
形式定义
形式语法
border-inline-width =
<'border-top-width'>{1,2}
<border-top-width> =
<line-width>
<line-width> =
<length [0,∞]>|
thin|
medium|
thick
示例
>HTML
html
<div> <p>示例文本</p></div>CSS
css
div { background-color: yellow; width: 120px; height: 120px;}.exampleText { writing-mode: vertical-lr; border: 1px solid blue; border-inline-width: 5px 10px;}规范
| Specification |
|---|
| CSS Logical Properties and Values Module Level 1> # propdef-border-inline-width> |