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
Release: 2024-12-03 10:49:10
Original
395 people have browsed it

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%
}
Copy after login

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template