Advertisement
Home Open Editor ❯

HTML sizes Attribute

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">

Try this code ❯

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">


Applies to:

The sizes attribute can be used on the following element:

Element Attribute
<img> sizes
<link> sizes

Advertisement

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">
Home Open Editor ❯
Advertisement