πŸš€ LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
πŸŽ“ COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

HTML Image Tag

Add images to your pages. Learn the <img> tag with src and alt.

image.html
<!-- Image -->
<img src="/photo.jpg"
alt="A photo">
πŸ“„
image.html
1 / 7
πŸ“„

Tutor:Images are embedded with the <img> tag. It is a void element: no closing tag. You need src (URL) and alt (description).


Image Mastery

Unlock nodes by learning image tag and src/alt attributes.

Concept 1: The Image Tag

The <img> tag embeds an image. It is a void element (no closing tag). You need src (image URL) and alt (description for accessibility).

System Check

Which attribute is required for <img> to display an image?

Community Holo-Net

Showcase Your Lists

Built a gallery or used images? Share your img and alt structures.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

HTML Image Tag Explained

Author

Pascual Vila

Frontend Instructor

Images are embedded with the <img> tag. It is a void element: use src for the image URL and alt for accessibility.

The Elements

src is the image URL; alt is the description for accessibility and when the image cannot load.

Void Element

Always include alt. Use meaningful text for content images; use alt="" for purely decorative images.

Accessibility

Screen readers announce β€œalt text” and use the alt attribute. Search engines use it too. Never omit alt for content images.

List Item Tag Glossary

<img> (Image)
The HTML void element that embeds an image. Requires src (URL) and alt (description).
src and alt
src holds the image URL; alt describes the image for accessibility.
alt attribute
Required for accessibility. Describe what the image shows; use empty alt only for decorative images.
Semantics
Using <img> with meaningful alt helps screen readers and SEO understand images.