Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

extend div height to entire webpage

Tags:

css

Is there a way I can extend the height of a div to the entire webpage using css?

I am not using

.height
 {
  height:100%;
  }

But this will only extend to the height of the contents inside the div. The div should cover the entire webpage even if there is just a 1 line worth of content inside it.

like image 472
user544079 Avatar asked Jan 21 '23 00:01

user544079


1 Answers

Make sure all parent items have a height set. html / body / etc.

The element will take 100% of it's parents height but only if the parent does HAVE a height.

100% Of a non set height will result in another non set height ;)

like image 68
Edwin Avatar answered Jan 23 '23 04:01

Edwin