How to make the height REALLY 100%

后端 未结 6 2045
一生所求
一生所求 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 04:01

    It depends, if you put some element inside a div and table/div's and div's height is let's suppose 500px then the element within it with height 100% will be as much as this div.

    If you want make some element fit the whole page, you will have to put it under an element having the actual 100% with of the browser eg this is usually main containing table or parent div.

    EDIT:

    I have not tried below, but you can also do it this way using absolute positioning:

    
    

    But this approach is not always that ideal. If you are sure, you can implement that :)

提交回复
热议问题