The effect of background-size on background-position

Source: Internet
Author: User

The Background-size property is presented in CSS3, which sets the size of the background picture, which has no effect on background-position when the value of the property is set to an absolute value or as a percentage, which affects when set to Contain/cover. , and one of the values is invalid.

Background-size:contain This property will make the background image width or height fit the parent element, and if scaled, the background image will never exceed the parent element

Background-size:cover This property fills the background picture with the parent element, and if scaled, the background image may go beyond the parent element

The top value of position is invalid when the width of the picture is greater than the height

The left value of position is invalid when the width of the picture is less than the height

The effect of background-size on background-position

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.