What is the role of the sizes attribute in the <link> element?

The sizes attribute defines the dimensions of icons for visual media.

The sizes attribute in the <link> element specifies the dimensions of icons for visual media, such as favicons or touch icons. It helps the browser choose the most appropriate icon size for the device, ensuring optimal display. This attribute is particularly useful for providing multiple icon sizes for different devices, enhancing user experience.

<link rel="icon" href="favicon.ico" sizes="32x32" />
<link rel="apple-touch-icon" href="apple-icon.png" sizes="180x180" />
More cards18
Show all