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

    Document foundations · Lesson 3 of 16

    Attributes and character references

    id, class, data-* and reserved characters.

    8 minutes2 games

    An id identifies one element within a document; classes label reusable groups. data-* stores custom string data on an element. Write &lt; to display < as text and &amp; to display &.

    HTML
    <article id="lesson-1" class="lesson featured" data-level="beginner">
      <h2>HTML &amp; CSS</h2>
      <p>Write &lt;p&gt; to start a paragraph.</p>
    </article>
    <button type="button" disabled>Coming soon</button>
    ToolUse

    id

    Unique in the document

    class

    Reusable class names

    disabled

    Boolean attribute: presence enables it

    Important

    disabled="false" still disables a button. Boolean attributes depend on presence, not their text. Remove the attribute to enable the button.

    Interview question

    Can an element have multiple classes?

    Quick question

    How do you enable a disabled button?

    Exercise

    Create a p with id intro and classes note and featured.

    HTML

    Learn more from

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

    Played 0 of 2 games

    Sign in to save your progress and earn XP.

    PreviousMetadata and languageNextHeadings, paragraphs and formatting
    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.