Background-size:cover and-webkit-background-size

Source: Internet
Author: User

When using jade and styl to write a phone page, and the element is a background image, it is often used to background-size cover, which means that the background image is covered with the entire element, and to ensure that the background image aspect ratio.

That is, when the picture is smaller than the container, and cannot be implemented using Background-repeat, we can use cover; enlarge the background image to fit the size of the container

or the width height of the set element is the width of the background image, and the setting Margin-left is half the width of the element to center the element on the phone screen.

Background-size:cover and-webkit-background-size

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.