Responsive layout for CSS3-responsive layout home/html/css/css3

Source: Internet
Author: User

To make a mobile Web page need to use a responsive layout, the first need to re-HTML file header:

The main purpose is to control the width and prohibit the user to zoom, the specific parameters themselves Google a bit.
<meta name= "viewport" content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, User-scalable=no "/>

The following is the CSS to determine whether the PC-side or mobile-side
In fact, it is very simple, with CSS3 media query can be very convenient to achieve, do not need to use useragent God horse so troublesome.


/* Minimum width 800 is the PC side */@media all and (min-width:800px) {  #nav {    width:300px;    Float:left;    margin-right:20px;  }  #grid {    width:450px;    Float:left;}  } /* Maximum width 799 is the mobile end */@media all and (max-width:799px) {  #nav {    width:100%;  }  #grid {    width:100%;  }}

Knowing that the above 2 o'clock can implement the responsive layout, is it very simple?

Responsive layout for CSS3-responsive layout home/html/css/css3

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.