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

Home Forums CSS Stacking divs

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #40135

    I’m not sure if this would be a CSS or JavaScript question, so please forgive me if it’s in the wrong place.

    Anyways, I have two divs that have equal width and are side by side. Lets call them div1 and div2. Div1 being on the left and Div2 being on the right. How could I make Div2 move above Div1 after my browser window has been resized or viewed on a small enough mobile device?

    I know in CSS I can use @media only screen and (min/max-width: —px) to change the setup of the divs based on screen size but I didn’t know if I could make a div show above another one instead of below with css or would I have to use some javascript.


    It’s a cheat really.

    If you float them both RIGHT and put them in your HMTL in the wrong order (i.e. DIV 2 first) it works.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.