CKTIS / CSS
CSS-eigenschap `margin-block-start`
`margin-block-start` stelt de marge aan het logische begin van de blokas in; de schrijfmodus bepaalt waar dat ligt.
Versie: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
<'margin-top'>margin-block-start stelt de marge aan het logische begin van de blokas in; de schrijfmodus bepaalt waar dat ligt.
Bij writing-mode: vertical-rl ligt block-start rechts. Het voorbeeld meet de ruimte van 12 px tussen het eerste item en de rechterrand en de berekende margin-right.
Grammatica: <'margin-top'>.
De eigenschap is niet hetzelfde als margin-top. De marge kan in normale blokflow samenvallen, maar de marge van een flexitem niet.
Voorbeelden
<!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-start:12px';second.style.cssText='display:block;width:20px;height:20px';
const p=box.getBoundingClientRect(),a=first.getBoundingClientRect(),s=getComputedStyle(first);result.textContent='right-gap='+Math.round(p.right-a.right)+'; physical-right='+s.marginRight+'; physical-left='+s.marginLeft;
</script>Resultaat
right-gap=12; physical-right=12px; physical-left=0px
Het voorbeeld is lokaal uitgevoerd in een geïsoleerde Chrome-sessie zonder netwerk; het resultaat komt uit de CSS-API van de browser.