I would like to ask how height and float work. I have an outer div and an inner div that has content in it. Its height may vary depending on the content of the inner div but
Its because of the float of the div. Add overflow: hidden on the outside element.
overflow: hidden
<div style="overflow:hidden; margin:0 auto;width: 960px; min-height: 100px; background-color:orange;"> <div style="width:500px; height:200px; background-color:black; float:right"> </div> </div>
Demo