html tutorial - sizes Attribute in HTML - html5 - html code - html form




  • The sizes attribute defines the sizes of icons for visual media.
  • The sizes attribute is only used if rel="icon".

Syntax for sizes attribute in HTML:

<link sizes="HeightxWidth|any">

Difference between HTML 4.01 and HTML 5 for sizes Attribute:

HTML 4.01

  • The sizes attribute has not been defined.

HTML 5

  • The sizes attribute is added.

Applies To:

Element Attribute
<link> sizes

sizes Attribute Values:

Value HTML 4.0.1 HTML 5 Description
Heightxwidth No Yes Defines one or more sizes for the linked icon.The height and width values are separated by an "x" or "X".
any No Yes Defines that the icon is scalable

Sample Coding for sizes Attribute in HTML:

<!DOCTYPE html>
<html>
    <head>
        <link rel="icon" href="https://www.wikitechy.com/images/logo.png" 
        type="image/gif" sizes="25x25">
        </head>
        <body>
            <h1>Wikitechy!</h1>
        </body>
</html>

Code Explanation for sizes Attribute in HTML:

sizes Attribute Code Explanation

  1. <link> tag specifies a link between a document and an external resource.
  2. rel attribute defines the relationship between the current document and the icon.
  3. href attribute defines the URL of the icon.
  4. sizes attribute provides the sizes of icons.

Browser Support for sizes Attribute in HTML:

No No No No No

Tips and Notes

  • In major browsers, the sizes attribute is not currently supported.

Related Searches to sizes attribute in html