Unverified Commit a96739fc authored by Sam Taal's avatar Sam Taal Committed by GitHub

Add extra explanation to next/image about positioning (#27341)

* Add extra explanation to next/image about positioning

In my experience, when using next/image, a lot of devs forget about the `position: relative` when using `layout: fill`. I think it's a small and effective change to implement this one line to make it more clear.

* Update docs/api-reference/next/image.md

* lint-fix
Co-authored-by: 's avatarLee Robinson <me@leerob.io>
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent c3884e68
...@@ -103,6 +103,7 @@ viewports and scale up for larger viewports. ...@@ -103,6 +103,7 @@ viewports and scale up for larger viewports.
When `fill`, the image will stretch both width and height to the dimensions of When `fill`, the image will stretch both width and height to the dimensions of
the parent element, provided the parent element is relative. This is usually paired with the [`objectFit`](#objectFit) property. the parent element, provided the parent element is relative. This is usually paired with the [`objectFit`](#objectFit) property.
Ensure the parent element has `position: relative` in their stylesheet.
Try it out: Try it out:
......
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