WissensdatenbankPrüfungszentrum
DEDeutsch
Sprache wählen13

CKTIS / CSS

CSS-Eigenschaft `margin-bottom`

`margin-bottom` setzt unabhängig vom Schreibmodus den physischen unteren Rand der Box.

Version: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review

Syntax

<length-percentage> | auto | <anchor-size()>

margin-bottom setzt unabhängig vom Schreibmodus den physischen unteren Rand der Box.

Das Beispiel läuft mit writing-mode: vertical-rl: margin-bottom: 12px erzeugt im Inline-Fluss eine vertikale Lücke von 12 px, während das logische margin-block-end null bleibt.

Grammatik: <length-percentage> | auto | <anchor-size()>.

In diesem Modus entspricht unten dem inline-end und nicht dem block-end. Ein unterer Rand kann im normalen Blockfluss mit einem Nachbarrand kollabieren, nicht jedoch zwischen Flexelementen.

Beispiele

<!doctype html><meta charset="utf-8"><div id="box"><i id="first"></i><i id="second"></i></div><pre id="result"></pre><script>
box.style.cssText='display:flex;writing-mode:vertical-rl;width:60px;height:100px';first.style.cssText='display:block;width:20px;height:20px;margin-bottom:12px';second.style.cssText='display:block;width:20px;height:20px';
const a=first.getBoundingClientRect(),b=second.getBoundingClientRect(),s=getComputedStyle(first);result.textContent='y-gap='+Math.round(b.top-a.bottom)+'; physical-bottom='+s.marginBottom+'; logical-block-end='+s.marginBlockEnd;
</script>

Ergebnis

y-gap=12; physical-bottom=12px; logical-block-end=0px

Das Beispiel lief lokal in einer isolierten Chrome-Sitzung ohne Netzwerk; das Ergebnis stammt aus der CSS-API des Browsers.

Quellen