WebKit now includes the "srcset" attribute to allow developers to scale images in responsive website designs. The attribute works by creating a list of image sources that are tapped based on the pixel density of a display. JavaScript and CSS aren't able to perform the same function as effectively, writes Mat Marquis, and the "srcset" attribute also has the ability to take into account bandwidth as well as display resolution when suggesting an image size to the browser.

Related Summaries