Karthick
Karthick

Reputation: 13

Different image not getting picked up in HTML5

While trying to use different size images in same img tag, only the first image is picked up. The remaining images are not picked up on different display size device.

Here is the code that I am trying with.

<html>
    <body>
        <img src="image_1.jpg" sourceset="image_2.jpg 2x, image_3.jpg 6.5x" alt="Image">
    </body>
</html>

Upvotes: 1

Views: 57

Answers (2)

Gokul Nath KP
Gokul Nath KP

Reputation: 15574

Syntax error.

Change attribute name sourceset to srcset.

Upvotes: 1

AiD
AiD

Reputation: 1007

It seems you misspelled srcset. Try as follows:

<html>
<body>
<img src="image_1.jpg" srcset="image_2.jpg 2x, image_3.jpg 6.5x" alt="Image">
</body>
</html>

Upvotes: 1

Related Questions