I have a div that contains two other divs,, like this:
----------------------------
| | |
| | |
| div 1 | div 2 |
| | |
| | |
| | |
----------------------------
div 1 has a fixed width and in same cases i need to remove it.
div 2 is always shown. The container of the two div has a fixed width.
My problem is how to define div2 width. If there is div1, div2 width has to be x but if the div1 is not shown, div2 width has to be the same of the container. Div1 and div2 have the following css:
#div1{
width: 146px;
height: 118px;
float: left;
}
#div2{
height: 104px;
padding: 12px 5px 2px 11px;
float: left;
}
How can i do?
Write like this:
CSS
Check this http://jsfiddle.net/2zU3h/