FRONTEND DEVELOPMENT

HTML Learning Guide

Understand what HTML does, how its elements work, and when to use them. Choose a topic for explanations, examples, and study questions.

What is HTML?

HTML stands for HyperText Markup Language. It describes the structure and meaning of content on a webpage. You use it to identify headings, paragraphs, links, images, lists, forms, and other parts of a document.

“HyperText” refers to text connected through links. “Markup” means labeling content to describe its role. For example, wrapping a sentence in <p> and </p> identifies it as a paragraph.

HTML code

<h1>My Website</h1>
<p>Welcome to my page.</p>

Browser output

My Website

Welcome to my page.

How does the browser use it?

The browser reads an HTML document and builds a representation of its structure called the DOM—Document Object Model. It then uses that structure and styling rules to display the page.

The tags normally do not appear as text on the page. Instead, the browser uses them to understand the content. Browsers also provide default styles, which is why a heading already looks different from a paragraph before you write CSS.

Where do CSS and JavaScript fit?

HTML · Structure

Defines the content and its meaning.

“This is a navigation link.”

CSS · Presentation

Controls colors, spacing, typography, and layout.

“Make the navigation blue.”

JavaScript · Behavior

Adds programming logic and dynamic interactions.

“Update the results when someone searches.”

HTML is a markup language rather than a programming language. It describes content instead of expressing general-purpose logic such as loops and calculations. HTML alone still supports useful behavior, including links, forms, and expandable details.

What is semantic HTML?

Semantic HTML means choosing elements that describe the meaning or purpose of their content. “Semantic” simply means “related to meaning.”

For example, a heading identifies a topic, nav identifies major navigation, and main identifies the page's primary content. These elements explain what the content is, rather than just how it should look.

Generic container

<div>
  <a href="index.html">Home</a>
  <a href="about.html">About</a>
</div>

Div groups the links, but does not describe the purpose of that group.

Semantic container

<nav>
  <a href="index.html">Home</a>
  <a href="about.html">About</a>
</nav>

Nav identifies these links as a major navigation section.

Both examples may look identical in the browser. The difference is the meaning communicated by the HTML.

Why does it matter?

Use a meaningful element when one fits. Div and span are still useful when you need a generic container. Semantic HTML supports accessibility, but does not guarantee it by itself.

Start here

STEP BY STEP

Build Your First Webpage

Create files, write HTML, add CSS, compare folder structures, fix common problems, and learn how your page goes live.

Open the walkthrough →

Explore the topics

Start with Document Structure. All eight lessons are available below.

Overview study questions

Answer in your own words before opening each explanation.

What is HTML responsible for?

HTML describes the structure and meaning of page content. For example, it identifies a heading, paragraph, image, or navigation link.

How is HTML different from CSS?

HTML identifies what the content is. CSS controls how that content is presented, including its colors, spacing, and layout.

Why does HTML have styling before I add CSS?

Browsers include default styles. These give elements such as headings and lists a readable starting appearance. Your CSS can change that presentation.

Is JavaScript required for every interaction?

No. HTML already supports navigation links, form controls, and expandable details. JavaScript adds programmable behavior beyond those built-in capabilities.

Why not use the same generic element for everything?

Meaningful elements communicate each piece of content's role. Using appropriate headings, links, buttons, and other elements helps browsers and assistive technology provide the right behavior and structure.