I have 2 divs: one in the left side and one in the right side of my page. The one in the left side has fixed width and I want the one of the right side to f
I had a similar issue and came up with the following which worked well
CSS:
.top {
width: auto;
height: 100px;
background-color: black;
border: solid 2px purple;
overflow: hidden;
}
.left {
float:left;
width:100px;
background-color:#ff0000;
padding: 10px;
border: solid 2px black;
}
.right {
width: auto;
background-color:#00FF00;
padding: 10px;
border: solid 2px orange;
overflow: hidden;
}
.content {
margin: auto;
width: 300px;
min-height: 300px;
padding: 10px;
border: dotted 2px gray;
}
HTML:
top
left
right
This method won't wrap when the window is shrunk but will auto expand the 'content' area. It will keep a static width for the site menu (left).
And for auto expanding content box and left vertical box(site menu) demo:
https://jsfiddle.net/tidan/332a6qte/