B.6. background-position

By default, an element's background image (assigned with the background-image property) is aligned so that its top and left edges are flush with the top and left edges of the element (including any padding), respectively. With the background-position property, you can assign a different position for the image.

Inherited: No

See also: Section B.5background-image

B.6.1. Value

One position specifier, or two position specifiers separated by a space.

Each of the position specifiers may be a CSS length measurement (pixels, points, ems, etc.), a percentage, or one of the constants from Table B-1.

Table B-1. background-position constants
VerticalHorizontal
top, center, bottomleft, center, right

If you specify only one measurement ...

Get HTML Utopia: Designing Without Tables Using CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.