Your First Web Page

What You Need

You only need a text editor and a web browser. Professionals use editors like VS Code, but Notepad works too. Save the file with the .html extension and open it in a browser.

  1. Open a text editor and type the HTML below.
  2. Save it as index.html (encoding UTF-8).
  3. Double-click the file. It opens in your default browser.
  4. Edit, save, and refresh the browser to see changes.

The Page Structure

Every HTML5 page follows the same skeleton. Content inside <body> is displayed; everything in <head> describes the page.

Example

A complete starter page with the character set and viewport settings every modern page should have:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Page</title>
</head>
<body>

  <h1>Welcome to my website</h1>
  <p>This is my very first web page.</p>

</body>
</html>

Result

View the Source

You can see the HTML of any page: right-click and choose View Page Source (or press Ctrl+U). To inspect one element and its CSS, right-click it and choose Inspect. This opens the browser Developer Tools, the most useful learning tool a web developer has.