Unverified Commit a1eead87 authored by Chris Stott's avatar Chris Stott Committed by GitHub

Update image.mdx (#66618)

Using `overflow: hidden` on the image's parent element is not necessary,
as the image is already set to be the same dimensions as its parent with
no overflow, and `object-fit` only changes the image aspect ratio & crop
within those dimensions.
Co-authored-by: 's avatarSteven <steven@ceriously.com>
parent 31222b53
...@@ -197,7 +197,7 @@ By default, the img element will automatically be assigned the `position: "absol ...@@ -197,7 +197,7 @@ By default, the img element will automatically be assigned the `position: "absol
If no styles are applied to the image, the image will stretch to fit the container. You may prefer to set `object-fit: "contain"` for an image which is letterboxed to fit the container and preserve aspect ratio. If no styles are applied to the image, the image will stretch to fit the container. You may prefer to set `object-fit: "contain"` for an image which is letterboxed to fit the container and preserve aspect ratio.
Alternatively, `object-fit: "cover"` will cause the image to fill the entire container and be cropped to preserve aspect ratio. For this to look correct, the `overflow: "hidden"` style should be assigned to the parent element. Alternatively, `object-fit: "cover"` will cause the image to fill the entire container and be cropped to preserve aspect ratio.
For more information, see also: For more information, see also:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment