I have 3 divs that stack on top of one another. All have the same width and height, e.g. 500px x 500px.
Top div float right. 2nd one margin-left and margin-right are set auto. 3rd one float left. All have the same margin top of 50px and all clear:both.
Of course there's a wrapper div wrapping the 3 divs and width 100%.
Question: Why is that the 2nd div margin top doesn't push that 50px margin but overlaps the top div?
I have tried looking for answer in similar questions here but none are what I'm looking for.
Here's a sample of the html and css that I'm doing.
<!DOCTYPE html>
<html>
<head>
<style>
.wrapper{width:100%; clear:both;}
.haha{width:500px; height:500px; margin-top:50px; clear:both;}
.haha.right{float:right;}
.haha.left{float:left}
.haha.center{margin-left:auto; margin-right:auto;}
</style>
</head>
<body>
<div class="wrapper">
<div class="haha right"><img src="wahaha.jpg"></div>
<div class="haha center"><img src="wahaha.jpg"></div>
<div class="haha left"><img src="wahaha.jpg"></div>
</div>
</body>
</html>
JS Fiddle here http://jsfiddle.net/dhS2x/3/