Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Swapping the locations of two divs in a media query Reply To: [Solved] Swapping the locations of two divs in a media query

#206791
shaneisme
Participant

You sure can!

1) Move the markup of the main content above the sidebar in your markup (so that on your mobile view it’s stacked up correctly)
2) You should actually reverse your thinking on your media query. Make the mobile view your default, and change it when it gets above a 799px with floats, etc. That way you can add the following (inside your new 799px and up query):

#sidebar {
  /* your current styles here */
  right: 75%;
  left: auto;
}
#left {
  /* your current styles here */
  left: 25%;
  right: auto;
}