HTML <link> sizesAttribute

HTML link 标签参考手册HTML <link> Tag

Examples

Icons with specified sizes:

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

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Currently, almost no mainstream browsers support the sizes attribute.


Definition and Usage

The sizes attribute specifies the size of the icon for visual media.

This attribute can only be used when the linked resource is an icon (rel="icon").


Differences between HTML 4.01 and HTML5

The sizes attribute is new in HTML5.


Syntax

<link sizes="HeightxWidth|any">

Attribute Values

Value Description
HeightxWidth Specifies one or more sizes for the linked icon.
Height and width are separated by an "x" or "X".

Examples:

  • <link rel="icon" href="favicon.png.html" sizes="16x16" type="image/png"> (1 size)
  • <link rel="icon" href="favicon.png.html" sizes="16x16 32x32" type="image/png"> (2 sizes)
any Specifies that the icon is scalable (e.g., SVG images).

Example:

  • <link rel="icon" href="icon.svg.html" sizes="any" type="image/svg+xml"> (any size)


HTML link 标签参考手册HTML <link> Tag Other Extensions