How to force a DIV block to extend to the bottom of a page even if it has no content with CSS?

Spread the love

Sometimes, we want to force a DIV block to extend to the bottom of a page even if it has no content with CSS.

In this article, we’ll look at how to force a DIV block to extend to the bottom of a page even if it has no content with CSS.

How to force a DIV block to extend to the bottom of a page even if it has no content with CSS?

To force a DIV block to extend to the bottom of a page even if it has no content with CSS, we make the div’s height 100%.

For instance, we write

html,
body {
  height: 100%;
}

to make the html and body element’s height 100% to make them extend to the bottom of the screen.

Conclusion

To force a DIV block to extend to the bottom of a page even if it has no content with CSS, we make the div’s height 100%.

Leave a Reply

Your email address will not be published. Required fields are marked *