HTML divs, how to wrap content?

后端 未结 10 1757
忘了有多久
忘了有多久 2021-02-01 08:07

I have 3 div\'s like on this image:

\"enter

div1 has fixed width but variable hei

10条回答
  •  情歌与酒
    2021-02-01 08:51

    As CSS doesn't provide anything for that job yet, you will have to use Javascript.

    I would firstly create a page like on your first picture. Then I would use

    $("#div").height()
    

    , which returns the height of your div and compare this to your second div's height:

    if($("#div1").height() > $("div2").height())
      //change website...
    

    In the if body put the required css changes... That should do the trick.

提交回复
热议问题