In this section we will show you how to create paging instances by using CSS. If your site has many pages, you need to use paging to navigate each page. The following example demonstrates how to use HTML and CSS to create pages: CSS instance « 1 2 3 4 5 6 7 » If you click the current page, you can use the CSS instance CSS instance « 1 2 3 4 5 6 7 » Can be used CSS instance « 1 2 3 4 5 6 7 » We can add CSS instance « 1 2 3 4 5 6 7 » We can use it. CSS instance Tip: add fillets to the first and last paging links: « 1 2 3 4 5 6 7 » CSS instance Tip: you can use the « 1 2 3 4 5 6 7 » CSS instance « 1 2 3 4 5 6 7 » We can use it. CSS instance « 1 2 3 4 5 6 7 » If you want to center the page, you can add it on the container element (such as < div >) CSS instance CSS instance Home page Front end HTML tutorial HTML paragraph Another kind of navigation is bread crumb navigation. An example is as follows: CSS instance 8.18.1. Simple paging ¶
ul.pagination{
display:inline-block;
padding:0;
margin:0;
}
ul.pagination li{display:inline;}
ul.pagination li a{
color:black;
float:left;
padding:8px 16px;
text-decoration:none;
}
8.18.2. Click and mouse over paging style ¶
.active
to set the current page style, you can use the
:hover
selector to modify the style:ul.pagination li a.active{
background-color:#4CAF50;
color:white;
}
ul.pagination li a:hover:not(.active){background-color:#ddd;}
ul.pagination li a.active {
background-color: #4CAF50;
color: white;
}
ul.pagination li a:hover:not(.active) {background-color: #ddd;}
Fillet styl ¶
border-radius
property to add a fillet style for the selected page number:ul.pagination li a {
border-radius: 5px;
}
ul.pagination li a.active {
border-radius: 5px;
}
Mouse hover transition effect ¶
transition
property to add a transition effect when the mouse moves over the page numberul.pagination li a {
transition: background-color .3s;
}
8.18.3. Paging with a border ¶
border
property to add paging with borders:ul.pagination li a {
border: 1px solid #ddd; /\* Gray \*/
}
Fillet border ¶
.pagination li:first-child a {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.pagination li:last-child a {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
Paging interval ¶
margin
property to add spaces directly to each page number:ul.pagination li a {
margin: 0 4px; /\* 0 Corresponding to the head and bottom, you can modify it to see the effect \*/
}
8.18.4. Paging font size ¶
font-size
property to set the font size for pagingul.pagination li a {
font-size: 22px;
}
8.18.5. Center paging ¶
text-align:center
style:div.center {
text-align: center;
}
8.18.6. More Instanc ¶
8.18.7. Bread crumb navigation ¶
ul.breadcrumb {
padding: 8px 16px;
list-style: none;
background-color: #eee;
}
ul.breadcrumb li {display: inline;}
ul.breadcrumb li+li:before {
padding: 8px;
color: black;
content: "/\00a0";
}