HTML 101: How to Code a Basic HTML Webpage

This post is going to assume you are not at all experienced with HTML. This post will give you a glimpse into how you can make your own webpage on your computer using a few lines of HTML.

What you’ll need:

  • Notepad (or some other text editor)
  • A web browser 

Step 1: 

Create a text file in a folder of your choice named helloworld.html

2019-03-20

**Note: You can name it whatever you want, the name does not matter (as of now), just make sure it has the .html at the end of the file name to ensure that the computer reads it as an HTML file

2019-03-20 (1)2019-03-20 (2)

Step 2: 

Open the file using Notepad or any other text editor (I personally love Sublime Text) to edit the file

2019-03-20 (3)

In your file, type the following lines: 

<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
</html>

Behind the code: 

  • All HTML files start with <!DOCTYPE html>
  • <…> starts a tag, and </…> ends the tag
  • In the code above, we added a header and a page title inside an HTML tag

2019-03-20 (4)

Step 3: 

Next, we add a body to our webpage. After the </head> but before </html> , add the following lines: 

<body>
<p>Hello world!</p>
</body>

Behind the code: 

Here, we added a paragraph inside the body of the page. The paragraph only says “Hello world!”

2019-03-20 (6)

Step 4: 

We now have the code for a basic HTML page. Save the text file and open the file with Google Chrome or a browser of your choice.

2019-03-20 (7)

Step 5: 

The result! Your page should have opened up to say “Hello World!”

2019-03-20 (8)

If you followed this tutorial, you just built your first webpage! 

Leave a comment