javascript - Avoid overlapping divs horizontally -


i want modify css or javascript success 2 conditions:

example: (------------------main div-----------------------------)(------right div -----)

conditions:
1) if there div in right of main div, display main div example.
2) if right div dont exist, main div must width.

i can set width determinated size dont meet conditions.

somebody can me?.

this answered here : 2 column div layout: right column fixed width, left fluid

use width:auto , overflow:hidden css styles main div takes required width.

example html :

<div class="right">     right div fixed width </div> <div class="left">     left main div flexible width </div> 

css :

.right {   width: 180px;   float: right;   background: #aafed6; }  .left {   width: auto;   background:blue;   overflow: hidden;  }​​ 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

c++ - No viable overloaded operator for references a map -

java - UML - How would you draw a try catch in a sequence diagram? -