4 ways to scale a page in HTML5

Source: Internet
Author: User

1.viewport


This method, not all browsers are compatible
<meta name= "viewport" content= "Width=640,minimum-scale=0.5,maximum-scale=1.0,user-scalable=no, initial-scale= 1.0 "/>


2. Percentage
This method can be compatible with most browsers, but the range of changes is large
. Main. Login. txt1{margin-top:8.59375%; position:relative;}


3.css Transform
This method can be compatible with most browsers, but the location of the page is centered
. w320
{
Transform:scale (a);
-ms-transform:scale (a); /* IE 9 */
-webkit-transform:scale (0.8,0.8); /* Safari and Chrome */
}


4. Use a responsive layout, but this would have to do two two sets of interfaces
<link rel= "stylesheet" type= "Text/css" media= "only screens and (max-width:480px), only screens and (max-device-width:48 0px) "href=" Link.css "/>

We recommend the 2nd, 4 kinds of

4 ways to scale a page in HTML5

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.