Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    </>HTML

    Document foundations

    • What is HTML?
    • Metadata and language
    • Attributes and character references
    • Headings, paragraphs and formatting

    Content and media

    • Links
    • Images
    • Lists
    • Tables
    • Responsive images and media

    Forms

    • Forms and inputs
    • Grouping form controls
    • Form validation and submission

    Structure and accessibility

    • Semantic HTML
    • Keyboard and screen-reader access
    • Disclosure with details
    • Project: your profile page
    HTML

    Content and media · Lesson 6 of 16

    Images

    Add an image with <img> and describe it.

    5 minutes3 games

    <img> has no closing tag. It needs two attributes:

    • src: where the image is.
    • alt: a text description for people who can't see it (screen readers, or if it fails to load). Never skip it.
    HTML
    <img src="https://picsum.photos/seed/seacode/320/180" alt="A random landscape photo" width="320">
    <p>Broken image, but the alt text still helps:</p>
    <img src="nope.jpg" alt="Our team at the Cairo office">

    Important

    Purely decorative images use alt="". Informative images need context-appropriate text.

    Interview question

    Why specify width and height?

    Quick question

    Why does alt matter?

    Spot the bug

    One line has a mistake that stops the image from showing.

    Exercise

    Add an image with src https://picsum.photos/200 and an alt.

    HTML

    Learn more from

    • MDN: HTML referencedeveloper.mozilla.org
    • web.dev: imagesweb.dev

    Played 0 of 3 games

    Sign in to save your progress and earn XP.

    PreviousLinksNextLists
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.