I have two divs,
<div class="right"></div>
<div class="left"></div>
In that order. For those wondering why I have ordered the HTML elements as such, check this question. The right div is of a fixed width along with the CSS property; float:right;
So when the page is resized, the left div expands to take up the rest of the page.
However, at a certain width, I want both divs to be 100% wide, but stacked such that the right div is below the left div.
I realise this is to do with the ordering of the html elements, but is there a way to make this work? I tried the solution from this thread, but it doesn't seem to work.
I have a fiddle here.
EDIT:
Ok, so I discovered the answer. I was missing a parent container div which needed display:table;
Now it works beautifully.
<div class="container">
<div class="right"></div>
<div class="left"></div>
</div>
CSS
.container {
display:table;
}
(Although I can't get it to work in the fiddle...)
So here is a CSS only solution if anyone needs it in future.