Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
Last updated on : 2023-03-20
Allows CSS Background images to be positioned relative to the edge of a box using offsets specified in the three to four value syntax.
Inherited
no
Applies to
all elements. It also applies to ::first-letter and ::first-line.
Percentages
refer to the size of the background positioning area minus size of background image; size refers to the width for horizontal offsets and to the height for vertical offsets
Initial value
0% 0%
Animation type
repeatable list of simple list of length, percentage, or calc
Computed value
background-position-x: A list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keyword background-position-y: A list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keyword
CSS Backgrounds and Borders Module Level 4 # background-position
/* Keyword values */
background-position: top;
background-position: bottom;
background-position: left;
background-position: right;
background-position: center;
/* <percentage> values */
background-position: 25% 75%;
/* <length> values */
background-position: 0 0;
background-position: 1cm 2cm;
background-position: 10ch 8em;
/* Multiple images */
background-position: 0 0, center;
/* Edge offsets values */
background-position: bottom 10px right 20px;
background-position: right 3em bottom 10px;
background-position: bottom 10px right;
background-position: top right 10px;
/* Global values */
background-position: inherit;
background-position: initial;
background-position: revert;
background-position: unset;
index.html
Source:index.html
background-position.htm
Source:background-position.htm
Browser Support For Android Browser Versions
Browser Support For Chrome for Android Versions
Browser Support For Firefox for Android Versions
Debug webpages on the go with LT Debug Chrome extension.
Add to ChromeTest your website on 3000+ real browsers and operating systems for mobile and desktop with the LambdaTest cloud. Perform browser compatibility test for CSS background-position edge offsets and many more web technologies that are a part of your website or web-application.
Last Modified date
2023-03-20
Data sourced from
Debug webpages on the go with LT Debug Chrome extension.
Add to ChromeHarness the power of Chromium-based engine to deliver responsive websites and web apps.
Try for freeGet 100 minutes of automation test minutes FREE!!