Why are my margins still collapsing?
Posted
by
Brandon Dorsey
on Stack Overflow
See other posts from Stack Overflow
or by Brandon Dorsey
Published on 2012-11-13T22:08:24Z
Indexed on
2012/11/13
23:00 UTC
Read the original article
Hit count: 201
My code in this "Fiddle" shows that I have adjacent elements which vertical margins are collapsing on one another. I understand that due to the nature of vertical margins in css, the largest of the two is chosen, In my case the p tag.
What I am having trouble with is trying to break the margins by using a 1px border or 1px padding. I've seen it work with other workarounds such as position:absolute
or float
method. I am not understanding why using 1px border or padding is not working properly to give me 15px of space.
© Stack Overflow or respective owner