Create a first HTML page on your computer

You can begin learning HTML with a text editor and a browser. HTML gives a page structure: headings identify sections, paragraphs hold prose and links connect resources.

Create a practice file

Open a plain-text editor, create a new file and enter the following example. Save it as practice.html in your Computer Practice folder. Choose a file type that preserves the .html extension rather than silently adding .txt.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My practice page</title>
</head>
<body>
  <h1>My learning notebook</h1>
  <p>Today I created a local HTML page.</p>
</body>
</html>

Open and compare

Open the file in your browser. The browser tab should use the title from the head section; the page should display the heading and paragraph from the body. If you see the code as plain text, check the file extension.

Make a small change

Change the paragraph in the editor, save the file and refresh the browser. Editing without saving will not update the browser’s copy of the file.

Understand the boundaries

A local HTML file is not automatically available to other people on the internet. Hosting, an address and server configuration are separate parts of publishing. This exercise does not require you to change an existing website or server.

Practice task

Add a second heading using an h2 element and a paragraph beneath it. Explain the difference between the browser-tab title and the visible h1 heading.

Continue with a learning path →
Scroll to Top