Switching order of HTML elements when layout changes in Responsive Web Design

后端 未结 6 1870
借酒劲吻你
借酒劲吻你 2021-02-04 11:19

I am building a responsive website, and for good user experience, I need some layout changes from mobile to desktop. Specifically, I need to switch the order of some HTML elemen

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-04 12:10

    Depending on your layout there will be a number of ways of achieving this. If your divs are stacking side by side on the desktop and vertically on mobile you might be able to use a combination of floats and media queries to get them displaying in the right order.

    If not your final fallback might be to create 4 divs.

    one
    three(mobile)
    two
    three(desktop)

    Then use media queries to hide the relevant "three" div depending on the device.

提交回复
热议问题