I need a fixed right column, and the left column to take up the remaining space. Then on mobile both columns will be full width, and the right column should float UNDER the left.
I followed this Stack question on how to make the right column fixed, and the left column a variable width: make a div fill up the remaining width
This involved me moving the right column div above the left column div in the HTML. So now in smaller browsers when I make both columns 100% width, the right side floats above the left, but I would like the right column to float under the left.
Any ideas on what to change?
<div id="main">
<div id="primary">
left div<br/>left div<br/>left div<br/>left div<br/>left div<br/>left div<br/>
</div>
<div id="container">
middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div <br />bit taller
</div>
</div>
#main {
width: 100%;
}
#primary {
width: 100px;
float: right;
background-color: #fcc;
}
#container {
background-color: #cfc;
overflow: auto;
}
@media screen and (max-width: 500px) {
#primary, #container{
width: 100%;
}
#primary{
float:none;
}
}
}