Illustrated below are three separate images depicting the status of my divs in desktop view, mobile view, and what I am aiming for in mobile view.
1. Current Status of Divs in Desktop View:
HTML
<div id="wrapper">
<div id="left-nav">recent posts</div>
<div id="main">articles listing</div>
</div>
2. Result after applying media query for mobile devices to make both divs full width.
3. This Represents My Desired Outcome:
The solution I have devised involves rearranging the position of divs in the HTML using the float property as shown below.
<div id="wrapper">
<div id="main" style="float:right;">articles listing</div>
<div id="left-nav" style="float:left;">recent posts</div>
</div>
This method works on mobile view after clearing floats. However, since this is within a CMS, I would prefer achieving this through CSS if possible.
Issue: When I make both divs full width in mobile view with media queries, the recent articles div appears before the article listing. How can I ensure that Articles listing comes first followed by recent posts?