A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/css/properties/background-position-x below:

background-position-x · WebPlatform Docs

background-position-x Summary

Sets the horizontal position of a background image.

Overview table
Initial value
0%
Applies to
All elements
Inherited
No
Media
visual
Computed value
as specified
Animatable
No

CSS Object Model Property
:

Syntax Values
length
Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px). For more information about the supported length units, see CSS Values and Units Reference.
percentage
Integer, followed by a percent sign (%). The value is a percentage of the width or height of the object.
hAlignment
Horizontal alignment value (e.g. "left", "right", or “center”).
Examples

Moving the background image to the right by 50px.

background-position-x: 50px;

Moving the background image to the left by 50px.

background-position-x: -50px;

Moving the background image to the right by half the width of its element.

background-position-x: 50%;

Moving the background image to the left by half the width of its element.

background-position-x: -50%;

Centering a background image inside its element.

background-position-x: center;
Usage
 ===Usage===
Notes Remarks Syntax

background-position-x: length | percentage | hAlignment

Standards information

There are no standards that apply here.

Related specifications

[ ]
:

See also Related articles Background Related pages Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4