Skip to main content

WebKit supports srcset attribute on img elements

WebKit now supports the srcset attribute, making it easier to deliver high resolution images to high resolution displays without inconveniencing anyone else.

The srcset attribute is similar to the -webkit-image-set CSS function, in that it uses 1x, 2x, 3x modifiers to tell the browser which image to choose. For example, the 2x modifier marks the image that should be used if the display has more than two device pixels per CSS pixel. A blog post from WebKit.org explains that the srcset attribute can be thought of as "the markup equivalent to the CSS feature".

It is backwards compatible, so browsers that don't support the attribute will ignore it and fall back the src value.

You can read more about it on the official specification page at W3C.

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

The Creative Bloq team is made up of a group of design fans, and has changed and evolved since Creative Bloq began back in 2012. The current website team consists of six full-time members of staff: Editor Kerrie Hughes, Deputy Editor Rosie Hilder, Deals Editor Beren Neale, Senior News Editor Daniel Piper, Digital Arts and Design Editor Ian Dean, and Staff Writer Amelia Bamsey, as well as a roster of freelancers from around the world. The 3D World and ImagineFX magazine teams also pitch in, ensuring that content from 3D World and ImagineFX is represented on Creative Bloq.