Мой первый сайт

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.

Читайте также:  Python http api test

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.

Читайте также:  Фон при помощи css

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.

Источник

Сайт визитка

Многостраничный сайт содержит более одной страницы. Многостраничные сайты на чистом html+css называют сайтами-визитками. В которых несколько страниц: главная, портфолио, цены, контакты и тому подобное.

Рассмотрим простой пример многостраничного сайта-визитки.

Читайте также:  Code Result

Для начала нам нужно придумать макет (шаблон) сайта и чтобы он был адаптивным, то есть хорошо смотрелся как на мониторе, так и на смартфоне.

Связь между страницами сайта происходит через ссылки. В качестве примера создадим сайт из двух страниц (при необходимости страницы можно добавить), чтобы понять, как они взаимодействуют с друг другом.

В корневой папке создадим папку assets и поместим туда файлы logo.png и style.css.

Загаловок сайта

style.css

/* для блока — шапка */
header text-align: left; /* Выравнивание внутреннего контента по левому краю */
width: 95%; /* Ширина блока и общая ширина*/
height: 90px; /* Высота блока */
margin-right: auto; /* Авто-отступ справа */
margin-left: auto; /* Авто-отступ слева */
padding: 10px; /* Внутренние поля вокруг содержимого */
background: #eeeeff; /* Цвет фона */
>
/* для контейнера */
#container width: 97%;/* Ширина слоя или ширина макета+20px */
margin-right: auto; /* Авто-отступ справа */
margin-left: auto; /* Авто-отступ слева */
>
/* для блока — меню */
aside width: 27%; /* Ширина слоя */
float: left; /* Обтекание с соседним слоем */
padding: 5px; /* Внутренние поля вокруг содержимого */
background: #dddddd; /* Цвет фона */
right: 0px; /* Координата от правого края окна */
top: 0px; /* Координата от верхнего края окна */
>
/* для блока — контент */
article < /* Правая колонка*/
width: 70%;/* Ширина слоя */
float: left; /* Обтекание с соседним слоем */
padding: 10px; /* Внутренние поля вокруг содержимого */
background: #eeeeee; /* Цвет фона */
>
/* для блока — подвал */
footer width:95%; /* Ширина слоя */
clear:left; /* возвращаем блочность и располагаем слой слева */
padding: 10px; /* Внутренние поля вокруг содержимого */
background:#aaa;
color:#fff;
margin-right: auto; /* Авто-отступ справа */
margin-left: auto; /* Авто-отступ слева */
>
@media screen and (max-width: 768px) aside, article, footer, header, #container margin-left:0px;
margin-top:0px;
width:100%;
margin-right: auto; /* Авто-отступ справа */
margin-left: auto; /* Авто-отступ слева */
>
aside padding: 10px;
>
>

Это папка будет служить для хранения различных ресурсов.

В корневой папке создадим файлы index.html и page.html и вставим туда код.


«assets/style.css»/>



Задает содержание сайта вроде новости, статьи, записи блога, форума, анонсов и другой информации..

© 2022


main
Блок где располагается содержимое страницы.

aside
Тут располагается меню на другие страницы сайта.

Источник

Оцените статью