<! DOCTYPE html> statement under div height 100%

Source: Internet
Author: User
Problem: Declared in HTML page, page Div property Settings 100% page is not displayed properly


body {       max-width: 720px;       margin: 0 auto;     }.case {       background-color: #68CDD5;       height: 100%;     }

The case in the page is the largest div class, set the height:100%, the page does not display properly, the blue part is not covered with the entire page.

Cause: The parent tag is referenced when the HTML5 standard requires a height or width to be set as a percentage. Solve:

The label's parent tag is the label's height also needs to be defined, many people think this setting can also be displayed normally, but not, because the label's height is set to 100%, but the label parent tag is a label , this label also needs to define the height. So the final parameter to add is Html,body {height:100%;}.
Between HTML and body is a comma, not a space. Description This is a multi-label selector, not a derived selector.

html,body {       max-width: 720px;       margin: 0 auto;       height: 100%;     }.case {       background-color: #68CDD5;       height: 100%;     }

The normal page is displayed as follows

<! DOCTYPE html> statement under div height 100%

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.