Skip to content

Creating more files

Intro

For our next lesson, we’re going to need one more HTML file because we need another page on our site. So far we’ve only been working with an index.html file, which means we only have one page on our site, a home page.

But to add another web page, we’ll need to create another HTML file. In this example, we’ll create an About page.

Steps

Create file

To create another HTML file, make sure you have your Explorer open. Then, click on the New File button.

Then, type about.html in the textbox and press Enter. The file should automatically open up in your editor.

Add boilerplate

Type ! in the about.html file and press Tab.

Change title

Change the <title> element so it says About. Check the preview to make sure the browser tab says About.

<title>About</title>

Add heading

Next, put your cursor in between the <body> tags, type h1, and press Tab.

<h1></h1>

Lastly, type About in between the h1 tags.

<h1>About</h1>

If you check the preview, you should see the word About appear in big and bold letters. This is so we can tell the About page apart from the home page.

You can also edit the <title> element to say About as well.

<title>About</title>

End

And that’s how you can create multiple HTML files.

Final code

If you’ve been following along so far, this is the code that should be inside the about.html file.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About</title>
</head>
<body>
<h1>About</h1>
</body>
</html>