HTML describes the structure of a web page using elements. An element usually has an opening tag like <p> and a closing tag like </p>, with content in between.
The page skeleton
The browser expects a few elements on every page. The <head> holds information about the page, such as its title. The <body> holds everything visible.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My first page</title>
</head>
<body>
<h1>Hello!</h1>
</body>
</html>Headings and paragraphs
<h1>to<h6>are headings, from most to least important.<p>is a paragraph of text.- Use only one
<h1>per page for the main title.
Code examples
<body>
<h1>I'm Sievchhing</h1>
<p>I'm learning web development, one small step at a time.</p>
<h2>My hobbies</h2>
<p>Coding, football and reading.</p>
</body>Expected output
A large "I'm Sievchhing" heading with a short introduction, then a smaller "My hobbies" heading with one line of text.
<h1> is the main title of the page; <h2> starts a smaller section under it.
Common mistakes
Common mistake: Forgetting closing tags
Close every element you open, e.g. <p>...</p>. Missing tags can make the rest of the page look wrong.