HTML Images | Extraparse

HTML Images

October 05, 20231 min read70 words

Learn how to embed images in your HTML documents using the `<img>` tag.

Table of Contents

Author: Extraparse

Images

Images enhance the visual appeal of web pages and provide context to the content. They are embedded using the <img> tag.

Syntax

1<img
2 src="https://www.example.com/image.jpg"
3 alt="Description of image"
4 width="600"
5 height="400"
6/>

Responsive Images

Use srcset to serve different image sizes based on device capabilities.

1<img
2 src="image-small.jpg"
3 srcset="image-small.jpg 600w, image-medium.jpg 1200w, image-large.jpg 1800w"
4 sizes="(max-width: 600px) 600px, (max-width: 1200px) 1200px, 1800px"
5 alt="Responsive image example"
6/>
xtelegramfacebooktiktoklinkedin
Author: Extraparse

Comments

You must be logged in to comment.

Loading comments...