lundi 4 juillet 2016

How does negative margin on first child affect the position of the next elements?

if I have this dom structure

<div style="overflow:hidden;">
    <div id="d1" style="margin-top:-50px; height:10px;"></div>
    <div id="d2" style="height:30px;"></div>
    <div id="d3" style="height:30px;"></div>
</div>

My question is how the elements d2 and d3 will be placed? just after the first element? even if d2 will be hidden, and d3 will be half-hidden (10px hidden). Or the two elements will be placed in the visible area of the parent?

My question here is about the exact CSS specifications.

Aucun commentaire:

Enregistrer un commentaire