KennisbankExamencentrum
NL · NLNederlands (Nederland)
Taal kiezen13

CKTIS / CSS

CSS-eigenschap `margin-inline`

`margin-inline` is de verkorting voor de marges aan inline-start en inline-end, toegewezen door schrijfmodus en tekstrichting.

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

Syntax

<'margin-top'>{1,2}

margin-inline is de verkorting voor de marges aan inline-start en inline-end, toegewezen door schrijfmodus en tekstrichting.

Bij writing-mode: vertical-rl en LTR-richting betekent 8px 14px fysieke boven- en ondermarges. Het voorbeeld meet 8 px bovenruimte en 14 px tot het volgende item.

Grammatica: <'margin-top'>{1,2}.

Eén waarde stelt beide uiteinden in; twee waarden betekenen inline-start en daarna inline-end. Inlinemarges vallen niet samen; auto kan in een geschikte indeling vrije ruimte opnemen.

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;writing-mode:vertical-rl;direction:ltr;width:60px;height:100px';first.style.cssText='display:block;width:20px;height:20px;margin-inline:8px 14px';second.style.cssText='display:block;width:20px;height:20px';
const p=box.getBoundingClientRect(),a=first.getBoundingClientRect(),b=second.getBoundingClientRect(),s=getComputedStyle(first);result.textContent='top-gap='+Math.round(a.top-p.top)+'; item-gap='+Math.round(b.top-a.bottom)+'; physical='+s.marginTop+' '+s.marginBottom;
</script>

Resultaat

top-gap=8; item-gap=14; physical=8px 14px

Het voorbeeld is lokaal uitgevoerd in een geïsoleerde Chrome-sessie zonder netwerk; het resultaat komt uit de CSS-API van de browser.

Bronnen