css - Auto width for floated div -


here code

<div class='content'>   <div class='div1'>content</div>   <div class='div2'>content</div> </div> 
.content { width:300px;} .div1 { float:left;width:200px;} .div2 { float:left;width:100px;} 

in case need set display:none div2. possible set .div1 width full-size of .content ( 300px )

reorder divs, , use overflow: hidden:

<div class='content'>   <div class='div2'>content 2</div>   <div class='div1'>content 1</div> </div> 
.content { width:300px; overflow: hidden;} .div1 { overflow: hidden;} .div2 { float:left; width:100px;} 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -