H5 How to make the page display in full screen when the page content is small

Source: Internet
Author: User

Solution 1:

Settings are as follows:
html,body{

min-height:100vh;background-color:#fff;

}
This height does not first write dead, and satisfies the minimum height is full screen

Solution 2:

It can be laid out with VH and VW. 100VH and 100VW are the height and width of your device. The outer box is fixed, the height of all the boxes is equal to 100VH just occupy one screen so there will be no blank. A box like you can use JS to get the height and width of the device, and then use JS to set the height of the box, add up equal to the height of your device can be. The font size is expressed in rem. Relative to the root font size. Here are some practices for mobile-side layouts.

Solution 3:

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

Solution 4:

*{    padding: 0;    margin: 0;}body{    width: 100vw;    height: 100vh;}


The above describes the "(CSS) H5 page content, how to make the page full screen on the phone display it?" "The answer to the question, I hope to have the need to help users."
This article site link: http://www.codes51.com/itwd/4444477.html

H5 How to make the page display in full screen when the page content is small

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.