HTML - sizes Attribute



The sizes is an HTML attribute that specifies the sizes of the linked resources. It is used to provide the sizes of icons for visual media. And this is only used with rel="icon".

The sizes attribute can be used with the <link> element−

Syntax

Following is the syntax of the sizes attribute −

<link rel="icon" sizes="10x10">

Example

In the following example, we are using the sizes attribute with the <link> element, as follows −

<!DOCTYPE html>
<html>
<head>
   <link rel="icon" href="https://www.tutorialspoint.com/images/logo.png?v2" type="image/gif" sizes="10x10">
</head>
<body>
   <h2>tutorialspoint</h2>
   <h3>sizes attribute</h3>
   <p>Open this page in a <a href="https://www.tutorialspoint.com/index.htm" target="_blank">new window</a> to see the favicon. </p>
</body>
</html>

On running the above code, the output window will pop up displaying the text and a hyperlink along with a favicon image on the webpage.

html_attributes_reference.htm
Advertisements