Skip to content
techsnow

Introduction

Your First HTML Page

Create a file called index.html in your project folder and paste this in:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My First Page</title>
  </head>
  <body>
    <h1>Welcome to my website!</h1>
    <p>I am learning HTML with TechSnow.</p>
  </body>
</html>

What each line does

CodeMeaning
<!DOCTYPE html>Tells the browser this is a modern HTML5 document.
<html lang="en">The root of the page. lang says the content is in English.
<head>Information about the page (not shown on screen).
<meta charset="UTF-8">Lets the page show any character, including Urdu and emoji.
<meta name="viewport">Makes the page display correctly on phones.
<title>The text shown in the browser tab.
<body>Everything visible on the page.

Save the file, right-click it in VS Code and choose Open with Live Server (or just double-click the file). Your browser shows the heading and paragraph.