The best way to expand a container in full screen

I studied a little and saw many examples of how developers use this method to display the container in full screen and are most often used:

.container {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

and

html, body{
 height: 100%;
 margin: 0;
}

.container {
  min-height: 100%;
  margin: 0;
}

These are the most used methods for expanding a div in full screen when the container is a child of the body.

If you ask me, a method using an absolute position is not a good idea, because if you put other elements inside, you cannot relate to it because they have an absolute position.

A method using HTML and a 100% body seems a bit rudimentary.

So what is the best way to expand a container?

+4
source share

No one has answered this question yet.


All Articles