Open opendeluxe opened 1 year ago
I want to put images into a blog post with a fixed width but an automatically calculated height. How to do that?
Using code like
<Image src="/photos/test.jpg" alt="Photo" width={200} priority className="next-image" />
will return the error message:
Error: Image with src "/photos/test.jpg" must use "width" and "height" properties or "layout='fill'" property.
The property "layout=fill" doesn't work either, as it strechtes the image over the full screen size.
any ideas how to do that?
Try with CSS in main.css file
main.css
img.next-image-your-class { margin: 0; width: auto; height: 90px; }
In this example, I wanted fixed height, but width to remain scaled to that fixed height.
I want to put images into a blog post with a fixed width but an automatically calculated height. How to do that?
Using code like
will return the error message:
The property "layout=fill" doesn't work either, as it strechtes the image over the full screen size.
any ideas how to do that?