How To Create HTML Page Using Notepad & VS Code

Creating an HTML (Hypertext Markup Language) page is the first step in web development. HTML is the standard markup language used to structure content on the web. In this step-by-step tutorial you will learn how to create an HTML page using Notepad and Visual Studio Code.

Create HTML Page using Notepad

Step 1: Create the Basic HTML Structure:

Open your Notepad and write the HTML Code written in the following image.

basic html code in notepad
  • Document Type Declaration (<!DOCTYPE html>): Specifies the HTML version and document type.
  • <html> Element: The root element that contains all the content on the web page.
  • <head> Element: Contains meta-information about the document, such as the title and character encoding.
  • <title> Element: Sets the title of the web page displayed in the browser’s title bar.
  • <body> Element: Contains the visible content of the web page, including text, images, links, and more.
  • <h1> Element: Used to add main heading in a web page.

Step 2: Save the HTML Document:

Now save this HTML Document on your Desktop or anywhere.

save the html code written in notepad

Step 3: Choose the Appropriate File Extension “.html”

Here I have named the HTML Document index.html. It is not mandatory to give the same name, you can choose any name. But the file extension must be “.html”. Like – example.html, mywebsite.html, test.html.

notepad save as the .html extension

Step 4: Run the HTML Page on a Web Browser

After saving the HTML File, just double-click on it to open this HTML Page on the browser, or open your browser and drag the file to it.

Run the HTML Page on a Web Browser to see the output

Create HTML Page using Visual Studio Code

1. Create a New Folder on Your Desktop:

First, create a new folder on your desktop or anywhere and name it as you wish.

2. Open the Folder in Your VS code:

Open your Visual Studio Code editor » Click on the File » Click on the Open Folder.

open folder in vs code

3. Create a New HTML File:

On the left of your VS Code, you can see the Folder Explorer. Click on the create new file Icon (see the following image) to create a new HTML file (index.html).

Create HTML file in Visual Studio Code Code

4. Write and Save the HTML Code:

Write the HTML Code written in the following image and save it (Ctrl + s).

Write and Save the HTML Code in vs code

5. Run the HTML File:

To run an file, you can simply open the HTML file (index.html) on your web browser. But, there is a wonderful VS Code extension that you can use to run HTML files. The Extension name is Live Server.

Go to the VS Code extension section and install the Live Server Extension.

vs code live server extension to serve the html file

6. Run the index.html file using the live server:

After installing the live server extension, make sure that the index.html file tab is selected, then click on the “Go Live” button.

Run the html file by clicking the go live button

Done!. Creating an HTML page is the first step in web development. As you become more proficient, you can explore advanced HTML features and learn about CSS (Cascading Style Sheets) and JavaScript to enhance your web pages further. With practice and continuous learning, you’ll be on your way to becoming a skilled web developer.

Leave a Reply

Your email address will not be published. Required fields are marked *

We use cookies to ensure that we give you the best experience on our website. Privacy Policy