Contentful logo

Contentful Community

Different images for different devices

Hello. I have a question about image in contentful.
In my application, we show different image depends on device size. (Mobile, tablet and desktop)
I couldn’t find a place to add differentiation of images in content page.
Is it possible to add different images per devices/media queries?

Thank you.

Hi @ayumi,

Yes, it is possible. Either you create different versions of the same source image (e.g. different pixel dimensions, cropping, centering etc.) via the Image API, or you have two separate media fields in your content model (e.g. ‘Desktop Image’ and ‘Mobile Image’).

1 Like