I'm facing an issue with a div structure that contains two other divs displayed like this:
----------------------------
| | |
| | |
| div 1 | div 2 |
| | |
| | |
| | |
----------------------------
div 1 has a fixed width and sometimes needs to be removed. div 2 is always visible. The container of these two divs has a fixed width. My dilemma lies in how to determine the width of div2. When div1 is present, div2's width should be x, but when div1 is hidden, div2's width should match that of the container. The CSS for div1 and div2 is as follows:
#div1{
width: 146px;
height: 118px;
float: left;
}
#div2{
height: 104px;
padding: 12px 5px 2px 11px;
float: left;
}
Any suggestions on how to achieve this?