🠄 Back

How to Set Up an HTML File

Step 1: Create a New File

Open a text editor like:

Save the file with the extension: .html

+-------------------+ | mypage.html | +-------------------+

Step 2: Add Basic HTML Structure

Every HTML page starts with a basic structure.

<!DOCTYPE html>
<html>
<head>
    <title>My First Page</title>
</head>

<body>
    <h1>Hello World!</h1>
</body>
</html>
Browser View: -------------------------------- | Hello World! | --------------------------------

Step 3: Understand the Main Tags

Tag Purpose
<html> Main container for the webpage
<head> Stores page information
<body> Visible content goes here
<h1> Main heading
<p> Paragraph text

Step 4: Open the File in a Browser

Double-click the HTML file.

Computer Folder ↓ mypage.html ↓ Opens in Chrome / Edge / Firefox

Step 5: Edit and Refresh

After editing the file:

  1. Save the file
  2. Refresh the browser
Edit Code ↓ Save File ↓ Refresh Browser ↓ See Changes

Complete Example

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Simple Page</title>
</head>

<body>
    <h1>Welcome</h1>
    <p>This is my first HTML page.</p>
</body>

</html>