I have this div with class "circle-text" which contains a "p" element containing a small text.
The p element has top and bottom margins. Now this margins seems to be moved above the upper div instead of being between the div and the p, which I dont want.
CSS:
.circle-text {
/*float: right;*/ /* Uncomment it*/
width:20%;
border-radius: 50%;
background-color: green;
}
.circle-text p {
width:100%;
padding-top:50%;
padding-bottom:50%;
line-height:1em;
margin:2em 0;
text-align:center;
}
Here's the example: http://jsfiddle.net/bendtherules/3eebw/6/
Now if I add float: right;
to the upper div, it actually includes the margin now (which is exactly what I want).
How does that work? Also how can I mitigate this issue?