how to size a div's height to its container height, using CSS?

后端 未结 14 2177
太阳男子
太阳男子 2020-12-16 19:34

How to size a div\'s height to its container height, using CSS ?


  
14条回答
  •  孤城傲影
    2020-12-16 19:43

    If my understanding is correct and the default height of a div where no height is specified is auto then this is not possible without setting an explicit height on the containing div. If an explicit height is set on the containing div then height:100% on the contained div will mean that it grows to the height of the container.

提交回复
热议问题