Latest web development tutorials

HTML link sizes attributes

HTML link Tag Reference HTML <link> tag

Examples

With the specified size of icons:

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

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

There are few major browsers support sizes attributes.


Definition and Usage

sizes attribute specifies the size of the visual media icons.

Only when resources are linked icon (rel = "icon"), in order to use this property.


Differences between HTML 4.01 and HTML5

sizes attribute is new in HTML5 attributes.


grammar

<link sizes="HeightxWidth|any">

Property Value

描述
HeightxWidth 为被链接的图标规定一个或多个尺寸。
高度和宽度之间由一个 "x" 或 "X" 分隔。

实例s:

  • <link rel="icon" href="favicon.png" sizes="16x16" type="image/png"> (1 个尺寸)
  • <link rel="icon" href="favicon.png" sizes="16x16 32x32" type="image/png"> (2 个尺寸)
any 规定图标是可伸缩的(比如 SVG 图像)。

实例:

  • <link rel="icon" href="icon.svg" sizes="any" type="image/svg+xml"> (任何尺寸)


HTML link Tag Reference HTML <link> tag