Most of the people are not aware that we have some readymade styles using that we can design our own sites with perfection and it’s easy to integrate in our pages.
In the example I am going to explain how we can use the pagination from Bootswatch site.
Bootswatch is a site that gives readymade themes to design the sites, in that they have given several sample site designs which are commonly used such as Navbar, Buttons, Tables, Forms, Indicators, Progress bars, Containers and Dialogs, etc.
Steps to include the pagination styles
Step 1: Navigate to the site, you can find some samples themes.
Step 2: Choose the Simplex theme and download its styles as in the following screenshot:
Step 3: Preview the simplex theme and navigate to pagination.
Mouse hover on the left side of the pagination you can see <> link to download the html code for this pagination. The <> link is visible in the
Copy the code and paste in your html page (in the body tag)
Step 4: Copy the required pagination styles from the downloaded styles for simplex theme and paste in header styles.
Final Code:
- <!DOCTYPE html>
- <html>
-
- <head>
- <title>RK Home Page</title>
- <style>
- .pagination {
- display: inline-block;
- padding-left: 0;
- margin: 18px 0;
- border-radius: 4px;
- }
-
- .pagination > li {
- display: inline;
- }
-
- .pagination > li > a,
- .pagination > li > span {
- position: relative;
- float: left;
- padding: 8px 12px;
- line-height: 1.42857143;
- text-decoration: none;
- color: #444444;
- background-color: #ffffff;
- border: 1px solid #dddddd;
- margin-left: -1px;
- }
-
- .pagination > li:first-child > a,
- .pagination > li:first-child > span {
- margin-left: 0;
- border-bottom-left-radius: 4px;
- border-top-left-radius: 4px;
- }
-
- .pagination > li:last-child > a,
- .pagination > li:last-child > span {
- border-bottom-right-radius: 4px;
- border-top-right-radius: 4px;
- }
-
- .pagination > li > a:hover,
- .pagination > li > span:hover,
- .pagination > li > a:focus,
- .pagination > li > span:focus {
- z-index: 3;
- color: #ffffff;
- background-color: #d9230f;
- border-color: #d9230f;
- }
-
- .pagination > .active > a,
- .pagination > .active > span,
- .pagination > .active > a:hover,
- .pagination > .active > span:hover,
- .pagination > .active > a:focus,
- .pagination > .active > span:focus {
- z-index: 2;
- color: #ffffff;
- background-color: #d9230f;
- border-color: #d9230f;
- cursor: default;
- }
-
- .pagination > .disabled > span,
- .pagination > .disabled > span:hover,
- .pagination > .disabled > span:focus,
- .pagination > .disabled > a,
- .pagination > .disabled > a:hover,
- .pagination > .disabled > a:focus {
- color: #dddddd;
- background-color: #ffffff;
- border-color: #dddddd;
- cursor: not-allowed;
- }
-
- .pagination-lg > li > a,
- .pagination-lg > li > span {
- padding: 14px 16px;
- font-size: 17px;
- line-height: 1.3333333;
- }
-
- .pagination-lg > li:first-child > a,
- .pagination-lg > li:first-child > span {
- border-bottom-left-radius: 6px;
- border-top-left-radius: 6px;
- }
-
- .pagination-lg > li:last-child > a,
- .pagination-lg > li:last-child > span {
- border-bottom-right-radius: 6px;
- border-top-right-radius: 6px;
- }
-
- .pagination-sm > li > a,
- .pagination-sm > li > span {
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- }
-
- .pagination-sm > li:first-child > a,
- .pagination-sm > li:first-child > span {
- border-bottom-left-radius: 3px;
- border-top-left-radius: 3px;
- }
-
- .pagination-sm > li:last-child > a,
- .pagination-sm > li:last-child > span {
- border-bottom-right-radius: 3px;
- border-top-right-radius: 3px;
- }
- </style>
-
- </head>
-
- <body>
-
- <h1>This styles are implemented using Bootswatch</h1>
- <p>Designed by Ramakrishna Basagalla</p>
-
- <ul class="pagination pagination-sm">
- <li class="disabled">
- <a href="#">
- <<</a>
- </li>
- <li class="active"><a href="#">1</a></li>
- <li><a href="#">2</a></li>
- <li><a href="#">3</a></li>
- <li><a href="#">4</a></li>
- <li><a href="#">5</a></li>
- <li><a href="#">>></a></li>
- </ul>
-
- </body>
-
- </html>
Final Output of the page Hope this article helps a lot in designing the sites and ease our life for building complex styles.