prevent div moving on window resize

前端 未结 2 700
面向向阳花
面向向阳花 2021-02-19 10:38

I have a page with two divs \"list_events\" and \"right_content\" one next to each other. When I resize the window \"right_content\" moves down \"list_events\" but i dont want t

2条回答
  •  野的像风
    2021-02-19 11:19

    first add a parent div/wrap and put those two divs of yours into it.

    like so:

    then you can try the

    min-width(px/ems/ etc) on the parent/wrapper div like so:

    #wrap{
    min-width: 600px;
    }
    

    Overall, whatever size you add to the min-width itll scale the parent div down to the size specified.

    once the window is sized down past your specified size, itll behave like any other window.

    this is my way of doing it.

提交回复
热议问题