AFAIK: srcset created by Next depending on sizes, so you need to specify sizes in strict width descriptiors.
The sizes
attribute in the img
element is used to define the width of the image for different viewport sizes. It is often used in conjunction with the srcset
attribute for responsive images. The sizes
attribute takes a series of values separated by commas. Each value consists of a media condition followed by a corresponding width descriptor.
The width descriptors represent the intended display size of the image for a given media condition. The most common width descriptor is vw
, which stands for viewport width. However, other units are also available. The following units can be used for image sizes in the sizes
attribute:
- vw (Viewport Width): Represents a percentage of the viewport width. For example,