- How To Create A Multi Page Website In HTML
- Benefits Of Multi-Page Website
- Creating A Multi-Page Website In HTML
- Step 1 — Creating our first HTML page
- Step 2: Creating Two More Web Pages
- Step 3 — Linking Multiple Website Pages Together In HTML
- Step 4 — Running Our Multi-Page Website
- Result
- Multi-Page Website In HTML — Source Code
- Add Items To List C#
- How To Play Wordle
- How To Insert An Image In HTML — [Source Code]
- Full Screen Overlay Navigation Bar Using HTML, CSS and JAVASCRIPT [Free Source Code]
- Create A Dropdown List In HTML
- How TO — Make a Website
- Create a Website from Scratch
- A «Layout Draft»
- Navigation bar
- Side Content
- Main Content
- Footer
- First Step — Basic HTML Page
- Example
- My Website
- Example Explained
- Creating Page Content
- Header
- My Website
- Navigation Bar
- Content
- Footer
- Footer
- W3Schools Spaces
How To Create A Multi Page Website In HTML
One is a single-page website (not to be confused with a SPA) that has all its content in a single HTML web page or an HTML document.
The other type is a website that has multiple pages (multiple HTML documents). Each HTML web page has different content in it. They might or might not share the common stylings, including the header and the footer elements.
Benefits Of Multi-Page Website
A website that has limited content to display to the end users may use the benefits of a single-page website. But there are so many reasons why we see a lot of multi-page websites on the internet.
- A multi-page website segregates content on the website better. Rather than adding all the content for the website on a single page using headings, a multi-page website is able to better manage and showcase content on different pages based on the context.
- A multi-page website offers better user flow and user experience. Users use the top navigation to navigate between web pages of a website. The navigation menu makes it clear that such and such content is at such and such page.
- A multi-page website is search engine friendly. When you have a lot of content that differs in context between them, it’s a great idea to have a multi-page website. Not only users would be able to better understand the contents of the website, but also search engine bots that crawl your website are able to better segregate the contents based on the web pages.
Creating A Multi-Page Website In HTML
Now that we know the benefits of a multi-page website, let’s make a simple one in HTML.
Step 1 — Creating our first HTML page
Open a code editor like Visual Studio Code, Sublime Text or Notepad++. If you don’t have any of the text editors, open a notepad.
Then create a basic HTML structure like the one below (I will provide the source code at the end of the blog)
Save this notepad file in your preferred folder location and save it as index.html
Now, we will change the title and create a header for this web page
Step 2: Creating Two More Web Pages
Similar to how we created the home page, we will create two more web pages. The contact page and the about page. Our folder now looks like this.
Step 3 — Linking Multiple Website Pages Together In HTML
It’s now time to link the multiple pages that we have created on our website.
We will create a navigation menu that will link all of the pages together.
We will first change the code in our index.html page to the below:
And we will copy this nav element to the other pages as well (about.html and contact.html)
Step 4 — Running Our Multi-Page Website
Now, go back to your folder where you have saved all your files.
Right click on the index.html file and open this file with the preferred browser.
Result
This will open your multi-page website in the browser.
Use the navigation on the top to navigate between pages. This is how you can make multi-page websites easily.
Change the content of the web pages to the content that you want to add to your website.
Multi-Page Website In HTML — Source Code
Recent Posts
Add Items To List C#
A list represents a collection of strongly typed objects. This can be a list of integers, a list of strings, or a list of complex types. A list in C# is an easy way to maintain a collection of similar types and then using the functions that C# provides you can easily iterate on that list if you need to. There will be numerous use cases when you would need to add a new item to a list dynamically. For example, if you have a list of years that are from 2000 to 2020, now it’s time to add the next 10 years to that list. You would need to dynamically add items to the list so that you can use them.
How To Play Wordle
What is wordle? A common question that people ask other people or search online when they hear their friends or colleagues talking about it in meetings, chats, online forums, etc. Wordle is an online game that got launched last year in October and since then its popularity has not come down even one bit. Wordle is a game in which the user has to guess a five-letter word in the attempts provided. The simple user interface of the game provides five boxes in which the player has to type characters to form a word.
How To Insert An Image In HTML — [Source Code]
In this modern-day world, a website is nothing without an image. We have seen that websites in the late 90s or early 2000s had more text and less of images. This is not true today, every web page has lots and lots of images that portray their product, their business, or a blog in a much nicer and more descriptive way. Using graphics and infographics, web pages can convey their message in a great way without using too many words. Even in this blog post or other blog posts in this blog, we use a lot of images frequently with text to explain our topic.
Full Screen Overlay Navigation Bar Using HTML, CSS and JAVASCRIPT [Free Source Code]
In this blog post, we are going to create a fancy navigation bar using HTML, CSS, and Javascript. This navigation menu would be not just a regular navbar, but, a full-screen overlay navigation menu. This will be a responsive navigation bar menu that will be responsive for both mobile and desktop displays. It will be really fun to code this and navigation bars like these create an amazing impression of your website in the user’s head.
Create A Dropdown List In HTML
Dropdown lists if you have seen them before on other websites are extremely powerful. They provide the user a clear list to select a single option from the list of options that the dropdown menu provides. They provide a good overall user experience. An example of a dropdown list in a general everyday website is the month picker. Using a dropdown list you can give the user to select the month of their birth.
How TO — Make a Website
Learn how to create a responsive website that will work on all devices, PC, laptop, tablet, and phone.
Create a Website from Scratch
A «Layout Draft»
It can be wise to draw a layout draft of the page design before creating a website:
Navigation bar
Side Content
Main Content
Footer
First Step — Basic HTML Page
HTML is the standard markup language for creating websites and CSS is the language that describes the style of an HTML document. We will combine HTML and CSS to create a basic web page.
Example
My Website
A website created by me.
Example Explained
- The declaration defines this document to be HTML5
- The element is the root element of an HTML page
- The element contains meta information about the document
- The element specifies a title for the document
- The element should define the character set to be UTF-8
- The element with name=»viewport» makes the website look good on all devices and screen resolutions
- The element contains the styles for the website (layout/design)
- The element contains the visible page content
- The element defines a large heading
- The
element defines a paragraph
Creating Page Content
Inside the element of our website, we will use our «Layout Draft» and create:
- A header
- A navigation bar
- Main content
- Side content
- A footer
Header
A header is usually located at the top of the website (or right below a top navigation menu). It often contains a logo or the website name:
My Website
A website created by me.
Then we use CSS to style the header:
.header <
padding: 80px; /* some padding */
text-align: center; /* center the text */
background: #1abc9c; /* green background */
color: white; /* white text color */
>
/* Increase the font size of the element */
.header h1 font-size: 40px;
>
Navigation Bar
A navigation bar contains a list of links to help visitors navigating through your website:
Use CSS to style the navigation bar:
/* Style the top navigation bar */
.navbar overflow: hidden; /* Hide overflow */
background-color: #333; /* Dark background color */
>
/* Style the navigation bar links */
.navbar a float: left; /* Make sure that the links stay side-by-side */
display: block; /* Change the display to block, for responsive reasons (see below) */
color: white; /* White text color */
text-align: center; /* Center the text */
padding: 14px 20px; /* Add some padding */
text-decoration: none; /* Remove underline */
>
/* Right-aligned link */
.navbar a.right float: right; /* Float a link to the right */
>
/* Change color on hover/mouse-over */
.navbar a:hover background-color: #ddd; /* Grey background color */
color: black; /* Black text color */
>
Content
Create a 2-column layout, divided into a «side content» and a «main content».
We use CSS Flexbox to handle the layout:
/* Ensure proper sizing */
* box-sizing: border-box;
>
/* Column container */
.row <
display: flex;
flex-wrap: wrap;
>
/* Create two unequal columns that sits next to each other */
/* Sidebar/left column */
.side flex: 30%; /* Set the width of the sidebar */
background-color: #f1f1f1; /* Grey background color */
padding: 20px; /* Some padding */
>
/* Main column */
.main <
flex: 70%; /* Set the width of the main content */
background-color: white; /* White background color */
padding: 20px; /* Some padding */
>
Then add media queries to make the layout responsive. This will make sure that your website looks good on all devices (desktops, laptops, tablets and phones). Resize the browser window to see the result.
/* Responsive layout — when the screen is less than 700px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 700px) .row <
flex-direction: column;
>
>
/* Responsive layout — when the screen is less than 400px wide, make the navigation links stack on top of each other instead of next to each other */
@media screen and (max-width: 400px) .navbar a float: none;
width: 100%;
>
>
Tip: To create a different kind of layout, just change the flex width (but make sure that it adds up to 100%).
Tip: Do you wonder how the @media rule works? Read more about it in our CSS Media Queries chapter.
Tip: To learn more about the Flexible Box Layout Module, read our CSS Flexbox chapter.
What is box-sizing?
You can easily create three floating boxes side by side. However, when you add something that enlarges the width of each box (e.g. padding or borders), the box will break. The box-sizing property allows us to include the padding and border in the box’s total width (and height), making sure that the padding stays inside of the box and that it does not break.
You can read more about the box-sizing property in our CSS Box Sizing Tutorial.
Footer
At last, we will add a footer.
Footer
.footer <
padding: 20px; /* Some padding */
text-align: center; /* Center text*/
background: #ddd; /* Grey background */
>
Congratulations! You have built a responsive website from scratch.
W3Schools Spaces
If you want to create your own website and host your .html files, try our website builder, called W3schools Spaces: