KennisbankExamencentrum
NL · NLNederlands (Nederland)
Taal kiezen13

CKTIS / CSS

CSS-eigenschap `margin-bottom`

`margin-bottom` stelt ongeacht de schrijfmodus de fysieke ondermarge van het vak in.

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

Syntax

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

margin-bottom stelt ongeacht de schrijfmodus de fysieke ondermarge van het vak in.

Het voorbeeld gebruikt writing-mode: vertical-rl: margin-bottom: 12px maakt een verticale ruimte van 12 px in de inlineflow, terwijl de logische margin-block-end nul blijft.

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

In deze modus komt fysiek onder overeen met inline-end, niet met block-end. Een ondermarge kan in normale blokflow met een aangrenzende marge samenvallen, maar niet tussen flexitems.

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;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>

Resultaat

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

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

Bronnen