Your first HTML page
โ Report an issue with this lessonEvery HTML document follows the same basic skeleton. Open a text editor,
create a file called index.html, and type this exactly:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
Save it and open it in a browser (double-click the file). You should see a single line of text: "Hello, world!"
What each part does
<!DOCTYPE html>tells the browser this is a modern HTML document.<html>wraps the entire page.<head>holds information about the page -- nothing in here is visible on the page itself.<body>holds everything the visitor actually sees.
Almost every HTML tag comes in a pair: an opening tag
(<h1>) and a closing tag (</h1>),
with content in between.
Try it yourself
Exercise: Add an <h1> with your name and a <p> with a short bio inside the body.
// free preview
11 more lessons โ including Project: build a simple portfolio page โ plus a certificate are waiting.
Unlock the full course โ $29.99