Академический Документы
Профессиональный Документы
Культура Документы
Working on
the Project
CONTENTS
Pagination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Alerts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Error 404. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Website Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Google Search Console. . . . . . . . . . . . . . . . . . . . . . . . . . 18
2
Working on the Project
Pagination
Link to the project in CodePen:
http://bit.ly/step-webdev-lesson-11-1
Pagination plays an important role. It allows linking the
general content that occupies several pages.
Bootstrap 4 designs the homepage and adds interlinking
by using the Paginations component. Just imagine what will
happen to your blog after the number of posts reaches dozens
or even hundreds! The homepage will open for too long, and
no one will visit your site. Let's create a page numbering as
in Figure 1.
Figure 1
3
Lesson # 11
Create a container <nav>, and put the list <ul> in it. Every
list item <li> contains a link to a page:
<nav aria-label="...">
<ul class="pagination">
<li class="page-item disabled">
<a class="page-link" href="#"><i class="fas
fa-chevron-left"></i></a>
</li>
<li class="page-item active">
<a class="page-link" href="#">1</a></li>
<li class="page-item" aria-current="page">
<a class="page-link" href="#">2</a>
</li>
<li class="page-item">
<a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#"><i class="fas
fa-chevron-right"></i></a>
</li>
</ul>
</nav>
Figure 2
Now, set red background, red border, and white text for
the elements :active and :hover.
/* active, hover */
li.page-item.active .page-link, a.page-
link:active, a.page-link:hover {
background-color: #dc3545;
border: 1px solid #dc3545;
color: #fff;
}
5
Lesson # 11
The disabled class is to be set for it. Let's also set color
for borders but make it darker:
/* disabled */
li.page-item.disabled .page-link {
border: 1px solid #e6979e;
color: #e6979e;
}
Figure 3
6
Working on the Project
Alerts
Link to the project in CodePen:
http://bit.ly/step-webdev-lesson-11-2
Alerts may appear on a page in different situations, for
instance, to inform a user about a successful action or error.
In Bootstrap, this component is created with the alert
class. You can style this block by making it, say, green alert-
success.
Let's create an alert about the successful completion of
an action and add a title with an icon and text:
<!-- Success alert -->
<div class="alert alert-success" role="alert">
<h4 class="alert-heading"><i class="fas fa-check-
circle"></i> Success!</h4>
<p>This alert box indicates a successful or
positive action.</p>
<hr>
<p class="mb-0">Some text there.</p>
</div>
7
Lesson # 11
As you can see (Figure 4), all elements inside this tag
(a title, text, icon, and background) are designed in the same
style.
Figure 4
Figure 5
8
Working on the Project
9
Lesson # 11
Figure 6
Figure 7
Error 404
Link to the project in CodePen:
http://bit.ly/step-webdev-lesson-11-3
There is nothing worse than an error for visitors! This is
the most annoying thing that a user can see.
And imagine that your visitor tries to go to a page that
you have already deleted, she sees an error and cannot go
10
Working on the Project
Figure 8
Figure 9
11
Lesson # 11
Figure 10
Now create this for your site. First, develop the 404 page
using the template, as we have done before. We will stick to
the general style of the site: let's leave the header and footer
so that the visitor understands that he is on the right site.
Place an image and the info about why the user is on this
page in the center so that it corresponds to the general style.
It would be nice to add a button with a link to the homepage.
Create the file 404.html in the project folder and, as it
was already mentioned, leave the header and footer. Change
the title:
<title>Error 404</title>
Add an image and text in the main part of the page. Use
columns to split the page content into two equal blocks. Place
the picture in one column, text and the button with a link to
the homepage in the other one.
12
Working on the Project
13
Lesson # 11
Figure 11
Figure 12
14
Working on the Project
Figure 13
Figure 14
15
Lesson # 11
Figure 15
Figure 16
As you can see (Figure 17), it has all error pages (400,
401, and so on). You can take this document as a basis and
customize every page like we did it with the 404 error page.
16
Working on the Project
Figure 17
Website Optimization
You already know that site optimization is an important
stage (Figure 18). It helps websites take top positions in the
search results, which is cool because more people will visit
your site!
Figure 18
17
Lesson # 11
Figure 19
18
Working on the Project
Figure 20
19
Lesson # 11
Figure 21
20
Working on the Project
Figure 22
Figure 23
21
Lesson # 11
Figure 24
Figure 25
22
Working on the Project
Figure 26
23
Lesson # 11
Figure 27
Figure 28
24
Lesson # 11
Working on the Project
© STEP IT Academy
www.itstep.org
All rights to protected pictures, audio, and video belong to their authors or legal owners.
Fragments of works are used exclusively in illustration purposes to the extent justified by
the purpose as part of an educational process and for educational purposes in accordance
with Article 1273 Sec. 4 of the Civil Code of the Russian Federation and Articles 21 and 23
of the Law of Ukraine “On Copyright and Related Rights”. The extent and method of cited
works are in conformity with the standards, do not conflict with a normal exploitation of
the work, and do not prejudice the legitimate interests of the authors and rightholders.
Cited fragments of works can be replaced with alternative, non-protected analogs, and
as such correspond the criteria of fair use.
All rights reserved. Any reproduction, in whole or in part, is prohibited. Agreement of the
use of works and their fragments is carried out with the authors and other right owners.
Materials from this document can be used only with resource link.
Liability for unauthorized copying and commercial use of materials is defined according
to the current legislation of Ukraine.