What is HTML?
HTML (HyperText Markup Language) describes the structure and meaning of a web page. Browsers read HTML and turn it into the page you see. Every website, from a school portal to a shopping app, is built on HTML.
HTML is not a programming language. It has no loops or conditions. It is a markup language: you wrap content in tags that tell the browser what each piece is, such as a heading, a paragraph or a link.
What you need
- A computer and a browser such as Chrome, Firefox or Edge
- A text editor. VS Code is free and popular, and Notepad also works
- Nothing to install. The browser runs HTML directly
Your first web page
Create a file named index.html and type the following. Then double-click the file to open it in your browser.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first web page.</p>
</body>
</html>Elements, tags and attributes
- A tag is a keyword in angle brackets, such as
<p>. - Most elements have an opening tag and a closing tag with a slash:
<p>text</p>. - An element is the opening tag, the content and the closing tag together.
- An attribute gives extra information, written inside the opening tag:
<html lang="en">.
Tip: Use lowercase tags and always close them. Clean habits now save hours of debugging later.
Practice
- Change the heading to your name.
- Add a second paragraph about your favourite subject.
- Save and refresh the browser to see the change.