How to make the height REALLY 100%

后端 未结 6 2154
一生所求
一生所求 2021-01-15 03:29

in CSS when you set something\'s width or height to 100% it really only sets it to 100% of the browser window. Is there any way to make it 100% of the whole page?

Le

6条回答
  •  情歌与酒
    2021-01-15 03:40

    100% width will be the width of the browser window if the element is not sized absolutely (e.g. 600px) or contained within another sized element.

    The height of the page is determined by how much space the content takes up vertically.

    So if you want something to cover a certain amount of space, create an element (i.e. a

    ) that has width and height set in pixels or ems, then the elements inside of it set to 100% will fill to that.

提交回复
热议问题