CSS Max Height Property

后端 未结 6 1421
自闭症患者
自闭症患者 2020-12-05 04:30

Is there a good cross-browser way to set a max-height property of a DIV and when that DIV goes beyond the max-height, it turns int

6条回答
  •  忘掉有多难
    2020-12-05 05:01

    Major hack (RedWolves-style):

    .divMax{width:550px;height:200px;overflow-Y:auto;position:absolute;}
    .divInner{border:1px solid navy;background-color:white;}
    

    I was getting no love from the max-height attribute so I had this alreadyand succeeded with these 2 classes. But it's ugly so in searching for better hit this question. divMax having position:absolute lets content underneath show through but controls the ultimate height of divInner to 200px.

提交回复
热议问题