CSS Background positioning attribute detailed

Source: Internet
Author: User
Keywords Web page production CSS Tutorials
Tags content default image not affected not affected by settings use web

Are you aware of the use of background-position properties in CSS, and here to share with you, this property positioning is not affected by the object's patch properties (padding) settings. The default is: 0% 0%, when the background picture is positioned in the upper-left corner of the content area where the object does not include patches (padding).

Description of background-position properties in CSS

Sets or retrieves the background image position of an object. The Background-image attribute must be specified first. This property positioning is not affected by the Patch property (padding) setting of the object. The default value is: 0% 0%. The background picture is positioned at the top-left corner of the content area where the object does not include patches (padding).

If only one value is specified, the value is used for the horizontal axis. The ordinate will default to 50%. If two values are specified, the second value is used for ordinate. If you set the value to Rightcenter, the background image will be positioned right as the horizontal axis value will overwrite the center value.

The corresponding script feature is background Position.

Syntax:

background-position:length| | Length

background-position:position| | Position

Value:

Length: Percent | A value of the lengths consisting of floating-point numbers and unit identifiers.

Position:top|center|bottom|left|center|right

background-position--defines the location of the background picture

Value:

[<percentage>|<length>|left|center|right] [<percentage>|<length>|top|center|bottom]]  * level  left: Left  center:  right: Right  * vertical  top: Upper  center:  bottom Vertical and horizontal combinations  x-%y-%  x-posy-pos    initial values: 0%0%   Inheritance: No   applies To: all elements   background: Background. Position: location.
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.