How to force child div to be 100% of parent div's height without specifying parent's height?

前端 未结 26 2195
刺人心
刺人心 2020-11-22 06:52

I have a site with the following structure:

<
26条回答
  •  半阙折子戏
    2020-11-22 07:48

    height : will only work if you have all parent nodes with specified percent height with a fixed height in pixels, ems, etc. on top level. That way, the height will cascade down to your element.

    You can specify 100% to html and body elements as @Travis stated earlier to have the page height cascading down to your nodes.

提交回复
热议问题