Images in HTML
The <img> tag embeds images. It is self-closing — no closing tag needed. Before 1993 the web had no images at all. Marc Andreessen added img and the internet changed forever.
Basic Image
The minimum you need is src and alt:
<img src="photo.jpg" alt="A beautiful mountain landscape" />
Fully Optimized Image
<img src="hero.webp" alt="Students learning HTML at CIWeb" width="800" height="400" loading="lazy" decoding="async" />
Image with Caption
Wrap in <figure> to add a caption:
<figure> <img src="chart.png" alt="Sales growth 2025" width="400" height="250" loading="lazy"/> <figcaption>Fig 1: CIWeb student growth in 2025</figcaption> </figure>
Attribute Reference
Google cannot see images — it reads alt text. Write descriptive alt like "A student coding HTML on a laptop" not just "image". This helps you rank in Google Images and contributes to page relevance.
Purely decorative images should have empty alt="" so screen readers skip them. Never omit alt entirely — screen readers would read the filename to blind users.
Marc Andreessen added the img tag in 1993 against objections from web purists. Today images represent 60% of all web data transferred worldwide every single day.