border-block-width

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.

Die border-block-width CSS-Eigenschaft definiert die Breite der logischen Blockränder eines Elements, die je nach Schreibrichtung, Richtung und Textorientierung des Elements einer physischen Randbreite zugeordnet wird. Sie entspricht der border-top-width und border-bottom-width, oder border-left-width und border-right-width Eigenschaft, abhängig von den Werten, die für writing-mode, direction und text-orientation definiert sind.

Probieren Sie es aus

Die Randbreite in der anderen Dimension kann mit border-inline-width festgelegt werden, was border-inline-start-width und border-inline-end-width setzt.

Syntax

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

/* Global values */
border-block-width: inherit;
border-block-width: initial;
border-block-width: revert;
border-block-width: revert-layer;
border-block-width: unset;

Werte

<'border-width'>

Die Breite des Randes. Siehe border-width.

Formale Definition

Anfangswertmedium
Anwendbar aufalle Elemente
VererbtNein
Prozentwertelogische Breite des beinhaltenden Blocks
Berechneter Wertabsolute Länge; 0, falls der Rahmenstil none oder hidden ist
Animationstypby computed value type

Formale Syntax

border-block-width = 
<'border-top-width'>{1,2}

<border-top-width> =
<line-width>

<line-width> =
<length [0,∞]> |
thin |
medium |
thick

Beispiele

Randbreite mit vertikalem Text

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: 1px solid blue;
  border-block-width: 5px;
}

Ergebnisse

Spezifikationen

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

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
border-block-width

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch