Three steps to implementing a responsive web design through CSS3

Source: Internet
Author: User

How to implement responsive web design with CSS3:

It is divided into three steps:

(1) Allow Web page width to be adjusted automatically.  First in the page header, we need to add this line: <meta name= "viewport" content= "width=device-width, initial-scale=1"/> Viewport is the default width and height of the Web page, the width of the page defaults to its own screen width (width=device-width), and the original scale (initial-scale=1) is 1.0, which is the initial size of the page that occupies 100% of the screen area.

(2) Flow layout. Do not use absolute width layout and font size, that is, in the code in CSS, the definition width and height can not use PX (WIDTH:PX) can only use the percentage (width:%) or (Width:auto) defined high width. The definition font size also uses relative units (EM) and does not use absolute units (px).

(3) Media query @media only screens and (MAX-WIDTH:PX) Max-width is executed when the screen is less than or equal to how much (Min-widt) is when the screen is greater than or equal to how much.

Three steps to implementing a responsive web design through 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.