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 2 of 16

    Metadata and language

    title, charset, viewport and writing direction.

    8 minutes2 games

    The head describes the document: title names the tab, charset sets character encoding, and viewport supports mobile layout. lang identifies the language and dir the writing direction; they are independent. For an Arabic document use <html lang="ar" dir="rtl">.

    HTML
    <!doctype html>
    <html lang="ar" dir="rtl">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <meta name="description" content="دروس برمجة قصيرة وتفاعلية">
      <title>تعلّم البرمجة</title>
    </head>
    <body><h1>أهلاً بيك</h1><p lang="en" dir="ltr">Hello, learner!</p></body>
    </html>
    ToolUse

    lang

    Content language

    dir

    Writing direction

    title

    Tab title

    Important

    The preview lives in a frame; its title will not change the main browser tab. Do not disable user zoom in the viewport.

    Interview question

    Does lang="ar" automatically set RTL?

    Complete the code

    Set the Arabic paragraph language and direction.

    <p lang="" dir="">أهلاً</p>

    Exercise

    Create an Arabic RTL main containing an h1.

    HTML

    Learn more from

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

    Played 0 of 2 games

    Sign in to save your progress and earn XP.

    PreviousWhat is HTML?NextAttributes and character references
    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.