我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The border-block-width CSS property defines the width of the logical block borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-width and border-bottom-width, or border-left-width, and border-right-width property depending on the values defined for writing-mode, direction, and text-orientation.

/* <'border-width'> values */
border-block-width: 5px;
border-block-width: thick;

The border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width.

Initial valuemedium
Applies toall elements
Inheritedno
Percentageslogical-width of containing block
Mediavisual
Computed valueabsolute length; 0 if the border style is none or hidden
Animation typediscrete
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Syntax

Values

<'border-width'>
The width of the border. See border-width.

Formal syntax

<'border-top-width'>

Example

HTML Content

<div>
  <p class="exampleText">Example text</p>
</div>

CSS Content

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

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

Specification

Specification Status Comment
CSS Logical Properties and Values Level 1
The definition of 'border-block-width' in that specification.
Editor's Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
border-block-width
Experimental
Chrome Full support 69
Disabled
Full support 69
Disabled
Disabled From version 69: this feature is behind the Experimental Web Platform Features preference (needs to be set to enabled). To change preferences in Chrome, visit chrome://flags.
Edge No support NoFirefox Full support 66IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 69Edge Mobile No support NoFirefox Android Full support 66Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also

文件標籤與貢獻者

此頁面的貢獻者: mdnwebdocs-bot, alattalatta, rachelandrew
最近更新: mdnwebdocs-bot,