Image Tag Usage
📖 Scenario: You are creating a simple webpage for a local bakery. You want to show a picture of a delicious cake on the page to attract visitors.
🎯 Goal: Build a basic HTML page that displays an image of a cake using the <img> tag with proper attributes for accessibility and responsiveness.
📋 What You'll Learn
Use the
<img> tag to display an imageInclude the
src attribute with the exact value cake.jpgAdd an
alt attribute with the text Delicious chocolate cakeSet the image width to
300 pixels using the width attributeUse semantic HTML structure with
<main> and <header> tags💡 Why This Matters
🌍 Real World
Images are essential on websites to show products, people, or places. Knowing how to add images properly helps make pages attractive and accessible.
💼 Career
Web developers must use the <code><img></code> tag correctly to ensure images load well, are accessible to screen readers, and look good on all devices.
Progress0 / 4 steps