Does html specification state what happens when both bottom and margin-bottom are specified?

StackOverflow https://stackoverflow.com/questions/23684740

  •  23-07-2023
  •  | 
  •  

Pregunta

To me specifying both bottom and margin-bottom seems like a contradiction. Because both are means to specify indent between the element and surrounding elements/containers. That is, bottom should be measured from the border, otherwise it's indent measured from indent. Does anyone know what the specification has to say?

¿Fue útil?

Solución

bottom property "specifies how far a box's bottom margin edge is offset above the bottom of the box's containing block"1. And

The margin edge surrounds the box margin. If the margin has 0 width, the margin edge is the same as the border edge. The four margin edges define the box's margin box."2

So yes, specification says that bottom is measured from margin edge.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top