HTML Basics: Build Your First Web Page
What Is HTML?
In this lesson you will
- Explain what HTML is and what it is used for
- Describe tags, elements and content
- Write the basic structure of an HTML page
Introduction
Every web page you have ever visited, from a news site to a video app, starts with the same thing: HTML. Think of a page as a house. HTML is the walls and rooms. It decides what is a heading, what is a paragraph, and where the picture goes.
The simple explanation
HTML tells the browser what each piece of content is.
HTML stands for HyperText Markup Language. "Markup" means you wrap your text in labels. The browser reads those labels and shows the page.
HTML is not a programming language. It does not calculate or make decisions. It only describes the structure of content.
Tags and elements
A label in HTML is called a tag. Most tags come in pairs: an opening tag and a closing tag. The closing tag has a slash.
HTML
<p>Hello, I am a paragraph.</p><p>is the opening tag.Hello, I am a paragraph.is the content.</p>is the closing tag.- All three together are one element.
Quick quiz
What is the difference between a tag and an element?
The shape of every page
Every HTML page has the same basic skeleton:
Press Run to see it. Then read what each part does:
<!DOCTYPE html>tells the browser this is a modern HTML page.<html lang="en">wraps everything.langsays the page is in English.<head>holds information about the page. You do not see it on the page itself.<title>is the name shown on the browser tab.<body>holds everything the visitor sees.
Where do I write HTML?
You only need two things: a plain text editor and a web browser.
- Write your HTML in a text file.
- Save it with the ending
.html, for exampleindex.html. - Open the file in your browser.
On this site you can skip all that. Every code card lets you edit and press Run.
Try it yourself
Change the text inside the h1 to your own name, then press Run. Then add a second p element with a sentence about yourself.
Quick quiz
Which part of an HTML page holds everything the visitor sees?
Summary
- HTML is the markup language that gives web pages their structure.
- An element is an opening tag, content and a closing tag.
- Every page has a doctype, an
htmlelement, aheadand abody.
Lesson complete
+20 XP
Nice work. Keep going while it is fresh.
Sources and further reading