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 Blockrahmen eines Elements, die je nach Schreibrichtung, Richtung und Textorientierung des Elements einer physischen Rahmenbreite zugeordnet wird. Sie entspricht der Eigenschaft border-top-width
und border-bottom-width
oder border-left-width
und border-right-width
, abhängig von den definierten Werten für writing-mode
, direction
und text-orientation
.
Probieren Sie es aus
border-block-width: thick;
writing-mode: horizontal-tb;
border-block-width: thick;
writing-mode: vertical-rl;
border-block-width: 4px;
writing-mode: horizontal-tb;
direction: rtl;
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element">
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;
}
Die Rahmenbreite in der anderen Dimension kann mit border-inline-width
festgelegt werden, die border-inline-start-width
und border-inline-end-width
setzt.
Syntax
/* <'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 Rahmens. Siehe
border-width
.
Formale Definition
Anfangswert | medium |
---|---|
Anwendbar auf | alle Elemente |
Vererbt | Nein |
Prozentwerte | logische Breite des beinhaltenden Blocks |
Berechneter Wert | absolute Länge; 0 , falls der Rahmenstil none oder hidden ist |
Animationstyp | by 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
Rahmenbreite mit vertikalem Text
HTML
<div>
<p class="exampleText">Example text</p>
</div>
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
Siehe auch
- CSS Logical Properties and Values
- Diese Eigenschaft ordnet sich einer der physischen Rahmeneigenschaften zu:
border-top-width
,border-right-width
,border-bottom-width
, undborder-left-width
writing-mode
,direction
,text-orientation