Back
Interactive Explainer

HTML basics

The skeleton of the web: structure, markup, and semantics.

HTML basics

The skeleton of the web: structure, markup, and semantics.

~2 min read
1 learner completed

What is HTML?

HTML (HyperText Markup Language) is the standard markup language for web pages. Browsers use it to render structure and content: headings, paragraphs, links, images, forms, and more. HTML describes what content is, not how it looks—that is the job of CSS.

Every HTML document has a basic structure: a doctype declaration, an html root element, head (metadata, title, links to stylesheets), and body (the visible content).

Elements and tags

HTML is made of elements. Each element is wrapped in tags: opening <tag> and closing </tag>. Some elements are self-closing (e.g. img, br). Attributes go on the opening tag (e.g. href on a, src on img) and provide extra information.

Common elements: headings (h1–h6), p for paragraphs, a for links, ul/ol and li for lists, div and span for grouping (div is block, span is inline). Use semantic elements when possible: header, main, nav, article, section, footer so screen readers and search engines understand the page.

Semantics and accessibility

Semantic HTML means choosing elements that match the meaning of your content. A button that submits a form should be <button type="submit">, not a div with a click handler. A list of navigation links benefits from <nav> and <ul>/<li>.

Good semantics improve accessibility (screen readers, keyboard navigation) and SEO. They also make the DOM easier to style and maintain.

Related concepts

Explore topics that connect to this one.

Suggested next

Often learned after this topic.

CSS basics

Ready to see how this works in the cloud?

Switch to Career Paths for structured paths (e.g. Developer, DevOps) and provider-specific lessons.

View role-based paths

Sign in to track your progress and mark lessons complete.

Discussion

Questions? Discuss in the community or start a thread below.

Join Discord

In-app Q&A

Sign in to start or join a thread.