CKTIS / CSS
CSS-eigenschap `margin-inline-end`
`margin-inline-end` stelt de buitenmarge aan het logische einde van de inline-as in; schrijfmodus en tekstrichting bepalen de fysieke zijde.
Versie: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntax
<'margin-top'>margin-inline-end stelt de buitenmarge aan het logische einde van de inline-as in; schrijfmodus en tekstrichting bepalen de fysieke zijde.
Het voorbeeld toont drie grenzen: bij horizontaal RTL ligt inline-end links en maakt 10% van een inline-grootte van 200 px een ruimte van 20 px; bij verticaal LTR ligt het onder en geeft 10% van 100 px 10 px; -6px laat buuritems overlappen.
Grammatica: <'margin-top'>.
Een percentage gebruikt de inline-grootte van het omvattende blok. Negatieve waarden zijn toegestaan, marges op de inline-as vallen niet samen en auto neemt alleen vrije ruimte op in een indeling die die ruimte verdeelt.
Voorbeelden
<!doctype html><meta charset="utf-8"><div id="h"><i></i><i></i></div><div id="v"><i></i><i></i></div><div id="n"><i></i><i></i></div><pre id="result"></pre><script>
const setup=(box,css,value)=>{box.style.cssText='display:flex;'+css;for(const item of box.children)item.style.cssText='display:block;width:20px;height:20px';box.firstElementChild.style.marginInlineEnd=value};setup(h,'direction:rtl;width:200px;height:30px','10%');setup(v,'writing-mode:vertical-rl;direction:ltr;width:30px;height:100px','10%');setup(n,'direction:ltr;width:100px;height:30px','-6px');const [ha,hb]=[...h.children].map(x=>x.getBoundingClientRect()),[va,vb]=[...v.children].map(x=>x.getBoundingClientRect()),[na,nb]=[...n.children].map(x=>x.getBoundingClientRect()),hs=getComputedStyle(h.firstElementChild),vs=getComputedStyle(v.firstElementChild);result.textContent='rtl-left-gap='+Math.round(ha.left-hb.right)+'; rtl-physical='+hs.marginLeft+'; vertical-bottom-gap='+Math.round(vb.top-va.bottom)+'; vertical-physical='+vs.marginBottom+'; negative-gap='+Math.round(nb.left-na.right);
</script>Resultaat
rtl-left-gap=20; rtl-physical=20px; vertical-bottom-gap=10; vertical-physical=10px; negative-gap=-6
Het voorbeeld is lokaal uitgevoerd in een geïsoleerde Chrome-sessie zonder netwerk; het resultaat komt uit de CSS-API van de browser.