Chapter 6
Beginner
8 min read
Core Elements
Images & Media
Add images, audio, video and other media to your web pages using HTML tags.
🎯 What you'll learn
✓Use the <img> tag to embed
images
✓Add alt text for accessibility
and SEO
✓Control image size with width
and height
✓Use srcset for responsive images
Introduction to Images & Media
This chapter covers Images & Media in depth. Understanding this topic is essential for writing clean, modern HTML. Use the live editor below to experiment as you read.
💡 In This Chapter
You will see real code examples, clear
explanations, and
a live editor to practice immediately — no setup needed.
Img Tag
Embeds an image on the page.
HTML
<img src="photo.jpg" alt="A beautiful photo" />
Attributes
Control size and behaviour.
HTML
<img src="photo.jpg" alt="photo" width="400" height="300" />
<!-- Video -->
<video src="clip.mp4" controls></video>
Try It Yourself
Edit the code below and click ▶ Run to see your changes live.
Live Editor
✎ Editor
👁 Preview
❓ Quick Check — Chapter 6
Which attribute on <img> provides text for screen readers?
📄 Chapter Summary
- Use the <img> tag to embed images
- Add alt text for accessibility and SEO
- Control image size with width and height
- Use srcset for responsive images