CSS background image background-position positioning

Source: Internet
Author: User

The default value is 0% 0%. In this case, the background image is located in the upper left corner of the content area of the object that does not include the patch.
If only one value is specified, the value is used for abscissa. The default ordinate value is 50%. If two values are specified, the second value is used for ordinate.
If the value is set to right center, right will overwrite the center value as the abscissa value, so the background image will be located on the right.
The corresponding script feature is backgroundposition.

Syntax:
Background-position: length | length
Background-position: position | position

Valid value:
Length: percent | length value composed of floating-point numbers and unit identifiers.
Position: top | center | bottom | left | center | right

Background-position -- define the position of the background image

Valid value:
[<Percentage> | <length> | left | center | right] [<percentage> | <length> | top | center | bottom]
* Level
Left: left
Center: Medium
Right: right
* Vertical
Top: top
Center: Medium
Bottom: bottom
* Vertical and horizontal combination
X-% y-%
X-pos y-pos

Initial value: 0% 0%
Inheritance: no
Applicable to: all elements
Background: background. position: position.

 

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.