CKTIS / CSS
CSS-Eigenschaft `margin-block-end`
`margin-block-end` setzt den Rand am logischen Ende der Blockachse und nicht an einer festen physischen Seite.
Version: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
<'margin-top'>margin-block-end setzt den Rand am logischen Ende der Blockachse und nicht an einer festen physischen Seite.
Bei writing-mode: vertical-rl liegt block-end links. Das Beispiel erzeugt einen horizontalen Flexfluss und misst die 12-px-Lücke zwischen den Elementen sowie den berechneten margin-left.
Grammatik: <'margin-top'>.
Ein anderer Schreibmodus ordnet den Rand einer anderen Seite zu. Im normalen Blockfluss kann er am Randkollaps teilnehmen; im gezeigten Flexlayout kollabiert er nicht.
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;flex-direction:column;writing-mode:vertical-rl;width:100px;height:50px';first.style.cssText='display:block;width:20px;height:20px;margin-block-end:12px';second.style.cssText='display:block;width:20px;height:20px';
const a=first.getBoundingClientRect(),b=second.getBoundingClientRect(),s=getComputedStyle(first);result.textContent='gap='+Math.round(a.left-b.right)+'; physical-left='+s.marginLeft+'; physical-right='+s.marginRight;
</script>Ergebnis
gap=12; physical-left=12px; physical-right=0px
Das Beispiel lief lokal in einer isolierten Chrome-Sitzung ohne Netzwerk; das Ergebnis stammt aus der CSS-API des Browsers.