Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
Last updated on : 2023-03-20
The object-fit property specifies how an element's content should fit within the available space, to the 'contain' value will scale down the content to fit the container while respecting its aspect ratio, while the 'fill' value will scale the content to fill the container at the cost of potentially distorting its aspect ratio.
Inherited
yes
Applies to
replaced elements
Percentages
refer to width and height of element itself
Initial value
50% 50%
Animation type
repeatable list of simple list of length, percentage, or calc
Computed value
as specified
CSS Images Module Level 3 # the-object-position
/* <position> values */
object-position: center top;
object-position: 100px 50px;
/* Global values */
object-position: inherit;
object-position: initial;
object-position: revert;
object-position: unset;
leftbar.html
Source:leftbar.html
parallax.css
Source:parallax.css
01-video-style.html
Source:01-video-style.html
Browser Support For Safari on iOS Versions
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 CSS3 object-fit/object-position 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!!