Responsive Web Design-Viewport

Source: Internet
Author: User

1.user-scalable: Whether the user can scale manually.

The 2.box-sizing property allows you to define certain elements in some way to fit the specified area. Specify the width and height of the box, and place the border and padding into the box.

[email protected] to set different styles for different screen sizes

4. Modify the background presentation (Background-color) If the document width is less than 300 pixels:

@media screen and (max-width:300px) {    body {         margin:0px; padding:0px; Color:rgb (170, 17, 17); " >lightblue;}    }

The 5.img,width property is set to 100%, and the image is responsive to the upper and lower bounds, and the image is larger than its original image. We can use the max-width property to solve this problem very well.

img {    max-width:100%;    Height:auto;}

The 6.HTML5 <picture> element can set multiple pictures.

<picture>  <source srcset= "img_smallflower.jpg" media= "(max-width:400px)" >  <source srcset= " Img_flowers.jpg ">  </picture>

  

  

Responsive Web Design-Viewport

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.