html - CSS - How do I float one element to the right inside the other div? -


i have div, inside div have 2 smaller ones, 1 of them left, , other 1 right, width of parent div not increase, how can make does?

i want red div increased height when div's inside bigger.

<div class="wrap">     <div class="left"></div>     <div class="right"></div>     <div class="footer">     </div> </div> 
.wrap{     margin:auto;     width:960px;     min-height:50px;     background:red; }  .left{     width:450px;     height:100px;     background:blue;     float:left; }  .right{     width:450px;     height:100px;     background:green;     float:right; }  .footer{ width:100%; height:100px; background:#000; } 

fiddle.

you can add after second div:

<div style="clear: both;"></div> 

or read clearfix


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -