Home >Web Front-end >CSS Tutorial >How Can I Make a Div Consistently Full Screen?

How Can I Make a Div Consistently Full Screen?

Susan Sarandon
Susan SarandonOriginal
2024-12-03 10:49:10351browse

How Can I Make a Div Consistently Full Screen?

Making a Div Consistently Full Screen

You want your div to be full screen regardless of its content. Is this possible?

Yes, it is possible.

The following CSS solution consistently fills the div to the full height of the screen, regardless of its content:

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

#wrapper {
  min-height: 100%
}

Four CSS attributes need to be set. One of them, the min-height for the wrapper div, only needs to be applied to make IE happy.

The above is the detailed content of How Can I Make a Div Consistently Full Screen?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn