I have a regular layout that looks that this:

This layout is done using CSS floats.
When I switch to mobile, I want my layout to do this:

That is, I want my sidebar to be below the content. I can do this using absolute positioning, but I was wondering, is there a way to do this using floats so that if my content changes the sidebar will adjust for the height difference?
Here’s how I would do it. The DIVs are floated on your desktop version, but displayed on top of eachother (default
blockdisplay) on mobile.CSS:
Standard HTML:
Mobile HTML: