95th section, mobile fluid layout and responsive layout summary

Source: Internet
Author: User

Summary of mobile fluid layout and responsive layouts

Width and height

The width of the block width is generally defined by the Max-width maximum width and percentage, because auto-scaling is achieved

Height if you want to adapt, you don't need to define a height or define a minimum height

Note: Use percentages as far as possible, such as margins, etc.

Picture Adaptive

Guaranteed to be smaller than the image resolution of the phone, adaptive equal width screen

The picture must be able to adapt the proportional scaling to ensure the correctness of the layout.

Method: Convert the IMG tag of the image to a chunk and set the maximum width to 100% so that the image will adapt.

img {    display: block;     max-width: 100%;}

Media Enquiry

Mobile Site General Media query is to control the font size

Responsive websites, media queries to control font size, width height, and block hiding

Media query is a mobile site and an important part of the adaptive site, media queries can be based on different screen size, response processing, such as the size of the text, block hiding and so on

    /*media query, greater than 480 less than 640*/@media (min-width:480px) and (max-width:640px){#tour H2 {font-size:. 26rem; }#tour H3{font-size:. 16rem; }#footer{font-size:. 14rem; }     }     /*media query, less than 480*/@media (max-width:480px){#tour H2 {font-size:. 18rem; }#tour H3{font-size:. 14rem; }#footer{font-size:. 12rem; }     } 

95th section, mobile fluid layout and responsive layout summary

Related Article

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.