Home >>CSS Tutorial >CSS Pagination
The CSS pagination is used to dividing the documents into pages and you have to add some sort of pagination to each page. If you have a website with lots of pages, it is very useful technique for indexing different pages of a website on the homepage.
These are the types of the pagination:
Let's take an example of simple pagination:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .pagination a { font-weight:bold; font-size:20px; color: black; float: left; padding: 8px 16px; text-decoration: none; } .php { font-size:42px; font-weight:bold; color:orange; margin-left:140px; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-left:140px; } </style> </head> <body> <div class = "php">phptpoint</div> <div class = "pagi">Simple Pagination</div> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </body> </html>
Let's take an example of bordered pagination:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .pagination a { font-weight:bold; font-size:20px; color: black; float: left; padding: 8px 16px; text-decoration: none; border:1px solid black; } .pagination a.active { background-color:#009900; } .pagination a:hover:not(.active) { background-color: #d4d5d2; } .php { font-size:42px; font-weight:bold; color:orange; margin-left:100px; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-left:140px; margin-bottom:20px; } </style> </head> <body> <div class = "php">phptpoint</div> <div class = "pagi">Bordered Pagination</div> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a class = "active" href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </body> </html>
Let's take an example of Active and Hoverable Pagination:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .pagination a { font-weight:bold; font-size:20px; color: black; float: left; padding: 8px 16px; text-decoration: none; } .pagination a.active { background-color:#f07816; } .pagination a:hover:not(.active) { background-color: #d4d5d2; } .php { font-size:42px; font-weight:bold; color:#f07816; margin-left:140px; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-left:90px; margin-bottom:20px; } </style> </head> <body> <div class = "php">Phptpoint</div> <div class = "pagi">Active and Hoverable Pagination</div> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a class = "active" href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </body> </html>
Let's take an example of rounded border pagination:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .pagination a { font-weight:bold; font-size:20px; color: black; float: left; padding: 8px 16px; text-decoration: none; border-radius:5px; border:1px solid black; } .pagination a.active { background-color:#f07816; } .pagination a:hover:not(.active) { background-color: #d4d5d2; } .php { font-size:42px; font-weight:bold; color:#f07816; margin-left:140px; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-left:110px; margin-bottom:20px; } </style> </head> <body> <div class = "php">phptpoint</div> <div class = "pagi">Rounded Border Pagination</div> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a class = "active" href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </body> </html>
Let's take an example of rounded active and hoverable buttons:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .pagination a { font-weight:bold; font-size:20px; color: black; float: left; padding: 8px 16px; text-decoration: none; } .pagination a.active { border-radius:5px; background-color:#f07816; } .pagination a:hover:not(.active) { background-color: #d4d5d2; border-radius:5px; } .php { font-size:42px; font-weight:bold; color:#f07816; margin-left:140px; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-left:40px; margin-bottom:20px; } </style> </head> <body> <div class = "php">phptpoint</div> <div class = "pagi">Rounded Active and Hoverable Pagination</div> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a class = "active" href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </body> </html>
Let's take an example of hoverable transition effect:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .pagination a { font-weight:bold; font-size:20px; color: black; float: left; padding: 8px 16px; text-decoration: none; } .pagination a.active { background-color:#f07816; } .pagination a:hover:not(.active) { background-color: #d4d5d2; } .php { font-size:42px; font-weight:bold; color:#f07816; margin-left:140px; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-left:40px; margin-bottom:20px; } </style> </head> <body> <div class = "php">phptpoint</div> <div class = "pagi">Hoverable Transition Effect Pagination</div> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a class = "active" href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </body> </html>
Let's take an example of space between the pagination:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .center { text-align:center; } .pagination a { font-weight:bold; font-size:20px; color: black; float: left; margin:0px 5px; padding: 8px 16px; text-decoration: none; border:1px solid black; } .pagination a.active { background-color:#f07816; } .pagination a:hover:not(.active) { background-color: #d4d5d2; } .php { font-size:42px; font-weight:bold; color:#f07816; text-align:center; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-bottom:20px; text-align:center; } </style> </head> <body> <div class = "php">phptpoint</div> <div class = "pagi">Space Between Pagination</div> <div class = "center"> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a class = "active" href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </div> </body> </html>
Let's take an example of centered pagination:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .center { text-align:center; } .pagination a { font-weight:bold; font-size:20px; color: black; float: left; padding: 8px 16px; text-decoration: none; border:1px solid black; } .pagination a.active { background-color:#f07816; } .pagination a:hover:not(.active) { background-color: #d4d5d2; } .php { font-size:42px; font-weight:bold; color:#f07816; text-align:center; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-bottom:20px; text-align:center; } </style> </head> <body> <div class = "php">phptpoint</div> <div class = "pagi">Centered Pagination</div> <div class = "center"> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a class = "active" href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </div> </body> </html>
Let's take an example of pagination size:
<!DOCTYPE html> <html> <head> <style> .pagination { display: inline-block; } .center { text-align:center; } .pagination a { font-weight:bold; font-size:25px; color: black; float: left; padding: 8px 16px; text-decoration: none; border:1px solid black; } .pagination a.active { background-color:#f07816; } .pagination a:hover:not(.active) { background-color: #d4d5d2; } .php { font-size:42px; font-weight:bold; color:#f07816; text-align:center; margin-bottom:60px; } .pagi { font-size:24px; font-weight:bold; margin-bottom:20px; text-align:center; } </style> </head> <body> <div class = "php">phptpoint</div> <div class = "pagi">Pagination Size</div> <div class = "center"> <div class="pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a class = "active" href="#">5</a> <a href="#">6</a> <a href="#">7</a> <a href="#">8</a> <a href="#">9</a> <a href="#">10</a> <a href="#">»</a> </div> </div> </body> </html>