border-bottom-width
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Die border-bottom-width
CSS-Eigenschaft legt die Breite des unteren Rands eines Elements fest.
Probieren Sie es aus
border-bottom-width: thick;
border-bottom-width: 2em;
border-bottom-width: 4px;
border-bottom-width: 2ex;
border-bottom-width: 0;
This is a box with a border around it.
#example-element {
background-color: palegreen;
color: #000;
border: 0 solid crimson;
padding: 0.75em;
width: 80%;
height: 100px;
}
Syntax
/* Keyword values */
border-bottom-width: thin;
border-bottom-width: medium;
border-bottom-width: thick;
/* values */
border-bottom-width: 10em;
border-bottom-width: 3vmax;
border-bottom-width: 6px;
/* Global keywords */
border-bottom-width: inherit;
border-bottom-width: initial;
border-bottom-width: revert;
border-bottom-width: revert-layer;
border-bottom-width: unset;
Werte
-
Definiert die Breite des Randes, entweder als explizite nicht-negative
oder als Schlüsselwort. Wenn es ein Schlüsselwort ist, muss es einer der folgenden Werte sein:thin
medium
thick
Hinweis:
Da die Spezifikation die genaue Dicke, die durch jedes Schlüsselwort bezeichnet wird, nicht definiert, ist das genaue Ergebnis bei der Verwendung eines davon implementierungsspezifisch. Dennoch folgen sie immer dem Muster thin ≤ medium ≤ thick
, und die Werte sind innerhalb eines einzelnen Dokuments konstant.
Formale Definition
Anfangswert | medium |
---|---|
Anwendbar auf | alle Elemente. Auch anwendbar auf ::first-letter . |
Vererbt | Nein |
Berechneter Wert | die absolute Länge; 0 falls border-bottom-style none oder hidden ist |
Animationstyp | Längenangabe |
Formale Syntax
Beispiele
Vergleich der Breiten des unteren Randes
HTML
Element 1
Element 2
CSS
div {
border: 1px solid red;
margin: 1em 0;
}
div:nth-child(1) {
border-bottom-width: thick;
}
div:nth-child(2) {
border-bottom-width: 2em;
}
Ergebnis
Spezifikationen
Specification |
---|
CSS Backgrounds and Borders Module Level 3 # the-border-width |
Browser-Kompatibilität
Siehe auch
- Die anderen CSS-Eigenschaften, die sich auf die Randbreite beziehen:
border-left-width
,border-right-width
,border-top-width
, undborder-width
. - Die anderen CSS-Eigenschaften, die sich auf den unteren Rand beziehen:
border
,border-bottom
,border-bottom-style
, undborder-bottom-color
.