HTML sizes Attribute

❮ HTML Attributes

Example

<img srcset="demo/book.png 320w, demo/cup.png 640w, demo/desk.jpg 1200w"sizes="100vw" src="demo/image.jpg" alt="demo" width="300" height="200">

Meaning

The sizes attribute specifies One or more strings separated by commas, specifies a set of source sizes.

Each source size consists of:




Standard Syntax

<element sizes="sizes">



Browser Support




Status




Applies to:

The sizes attribute can be used on the following element:

Element Attribute
<img> sizes
<link> sizes






Attribute Values

Value Description
sizes for more information: sizes, sizes



More Examples

Example

<link rel="icon" href="demo/demo-icon.png" type="image/png" sizes="16x16">
❮ HTML Attributes