link sizes Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:link


The sizes attribute specifies the sizes of icons for visual media.

This attribute is only used if rel="icon".

Attribute Values

HeightxWidth Specifies one or more sizes for the linked icon.
any Specifies that the icon is scalable (like an SVG image)


  • <link rel="icon" href="favicon.png" sizes="16x16" type="image/png"> (1 size)
  • <link rel="icon" href="favicon.png" sizes="16x16 32x32" type="image/png"> (2 sizes)
  • <link rel="icon" href="icon.svg" sizes="any" type="image/svg+xml"> (any size)

The following code shows how to set Icon with specified size:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
  <link rel="icon" href="" type="image/gif" sizes="16x16">
</head><!--from w ww.j a v  a  2s.  c om-->

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


Related Tutorials