Tutorials HTML Images & Media
Ch 6 / 21 ← Prev Next →
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
🚀
Sponsored
Learn Full-Stack Development — Join K2 Courses
Live mentoring · Real projects · Placement support · Certificate
Enroll Free
Advertisement
Google Ad — 728×90 Leaderboard

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
💡
Sponsored
Master CSS — The Next Step After HTML
56 chapters · Flexbox, Grid, Animations · Free to start
Start CSS →
Advertisement
Google Ad — 300×250 Medium Rectangle
Join WhatsApp Channel