HTML sizes Attribute

HTML sizes Attribute: This attribute specifies the sizes of icons for visual media. This attribute is only used if rel=”icon”. It was newly added to the HTML5 attribute.



HTML sizes Attribute

This attribute can be applied on <link> element.

Syntax: <link sizes=”HeightxWidth|any”>

Browser Support

The HTML sizes attribute is not supported by any browser.

Example: for <link> element

<!DOCTYPE html>
<html>
<head>
  <link rel="icon" href="demo_icon.gif" type="image/gif" sizes="16x16">
</head>
<body>

<h2>Hello world!</h2>
<p>Open this page in a <a href="tryhtml5_link_sizes.htm" target="_blank">new window</a> to see the favicon.</p>
</body>
</html>

Output:

 

Hello world!

Open this page in a new window to see the favicon.

Note: The sizes attribute is not currently supported in any of the major browsers.