CKTIS / CSS
Propriété CSS `margin-block-end`
`margin-block-end` définit la marge à la fin logique de l’axe de bloc plutôt que sur un côté physique fixe.
Version : CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review
Syntaxe
<'margin-top'>margin-block-end définit la marge à la fin logique de l’axe de bloc plutôt que sur un côté physique fixe.
Avec writing-mode: vertical-rl, block-end correspond au côté gauche. L’exemple crée un flux flex horizontal et mesure l’écart de 12 px entre les éléments ainsi que margin-left calculé.
Grammaire: <'margin-top'>.
Un autre mode d’écriture remappe cette marge sur un autre côté. Elle peut participer à la fusion des marges dans le flux de bloc normal, mais pas dans la disposition flex montrée.
Exemples
<!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>Résultat
gap=12; physical-left=12px; physical-right=0px
L’exemple a été exécuté localement dans une session Chrome isolée et sans réseau ; le résultat provient de l’API CSS du navigateur.