Code From ZeroCode From Zero
← Back to Course
Lesson 1 of 3
Module 1 · Lesson 1⏱ ~8 minHTML

What Is HTML?

The foundation of every website. Let's start from absolute zero.



What Is HTML?

HTML stands for HyperText Markup Language. It's not a programming language — it's a markup language. This is an important difference:

  • A programming language (like Python or JavaScript) tells the computer what to do — it has logic, calculations, and decision-making
  • A markup language (like HTML) tells the computer what things are — it describes and structures content

Think of HTML as the skeleton of a webpage. It says "here's a heading, here's a paragraph, here's an image." Every single website you've ever visited — Google, YouTube, Wikipedia — uses HTML underneath.


Tags and Elements

HTML uses tags to mark up content. Tags are written inside angle brackets < >:

html
<p>This is a paragraph.</p>

This whole thing — the opening tag, the content, and the closing tag — is called an element. Here are a few more examples:

html
<h1>This is a big heading</h1>
<p>This is a paragraph of text.</p>
<button>This is a clickable button</button>
  • <h1> — a top-level heading (the biggest one)
  • <p> — a paragraph of text
  • <button> — a clickable button

The pattern is always the same: an opening tag like <p>, then your content, then a closing tag like </p>. The closing tag always has a forward slash before the name.


Your First HTML Page

Every HTML page has the same basic structure. Here's the smallest valid HTML document:

html
<!DOCTYPE html>
<html>
  <head>
    <title>My First Page</title>
  </head>
  <body>
    <h1>Hello, world!</h1>
    <p>Welcome to my website.</p>
  </body>
</html>

What each part does:

  • <!DOCTYPE html> — tells the browser "this is an HTML5 document." Always goes at the very top.
  • <html> — wraps the entire page. Everything goes inside it.
  • <head> — contains information about the page (like the title that shows in the browser tab). Nothing in head is visible on the page itself.
  • <title> — the text that appears in the browser tab. Goes inside <head>.
  • <body> — everything visible on the page goes here: headings, paragraphs, images, buttons — all of it.

Headings and Paragraphs

HTML gives you six heading levels, from <h1> (most important) down to <h6> (least important):

html
<h1>Main Heading — the biggest</h1>
<h2>Subheading</h2>
<h3>Smaller subheading</h3>
<h4>Even smaller</h4>
<h5>Getting tiny</h5>
<h6>Smallest heading</h6>

Headings aren't just about making text big — they create structure. Search engines and screen readers use headings to understand your page. A well-structured page uses <h1> once for the main topic, then <h2>s for sections, and so on.

Paragraphs use the <p> tag:

html
<p>This is a paragraph. Browsers automatically add space between paragraphs.</p>
<p>This is another paragraph. Notice the gap between them.</p>

How to Try This

You don't need any special software to write HTML. Here's the simplest way to try it right now:

  1. Open any text editor — Notepad (Windows), TextEdit (Mac), or even Notes will work
  2. Paste the HTML from "Your First HTML Page" above
  3. Save the file as index.html (make sure the extension is .html, not .txt)
  4. Double-click the file — it opens in your browser!

Or use an online tool like codepen.io — it lets you write HTML and see the result instantly, no files needed.


Try It Yourself

Create a simple page about yourself. It should include:

  • A title (in the head)
  • A main heading with your name
  • Two paragraphs about yourself

Hint: start with the "Your First HTML Page" template and replace the content with your own.


Key Terms

HTML
HyperText Markup Language — the standard language for creating web pages. It describes the structure of a page using tags.
Tag
A keyword wrapped in angle brackets, like <p>. Tags tell the browser how to display content.
Element
An opening tag, its content, and a closing tag — all together. For example: <p>Hello</p> is a paragraph element.
Attribute
Extra information added to an opening tag, like href or src. Attributes modify how a tag behaves.

Check Your Understanding

What does HTML stand for?

Answer: HyperText Markup Language.

What is the difference between a tag and an element?

Answer: A tag is the keyword in angle brackets (like <p>). An element is the whole thing: opening tag, content, and closing tag together.

What goes inside the <head> vs the <body>?

Answer: The <head> contains information about the page (like the title). The <body> contains everything the user actually sees on the page.

Want the full web development course?

This is Lesson 1 of 10 in Website Builder From Zero. Learn HTML, CSS, and JavaScript — everything you need to build and publish your own websites.


Ready to learn more?

This was just the first lesson. The full course has 10 lessons that take you from absolute zero to building real projects — covering HTML, CSS, and JavaScript.