CSS peddle instance
In this section, we'll show you how to create peddle instances by using CSS.
Simple plying
If your site has many pages, you'll need to use pedding to navigate each page.
The following example shows how to use HTML and CSS to create peddles:
CSS instance
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;
}
Try it out . . .
Click and hover over the peddling style
If you click on the current page,
.active
to style the current page, and mouse over can
:hover
selector to modify the style:
CSS instance
background-color: #4CAF50;
color: white;
}
ul.pagination li a:hover:not(.active) { background-color: #ddd; }
Try it out . . .
CSS instance
background-color: #4CAF50;
color: white;
}
ul.pagination li a:hover:not(.active) {background-color: #ddd; }
Try it out . . .
Fillet style
You
border-radius
property to add fillet styles to selected page numbers:
CSS instance
border-radius: 5px;
}
ul.pagination li a.active {
border-radius: 5px;
}
Try it out . . .
Hover transition effect
We can add a
transition
when we move the mouse to the page number by adding the transition property to the page links to create a transition effect on hover:
Page with a border
We can
border
property to add bordered pages:
Fillet border
Tip: Add fillets to the first and last peddle links:
CSS instance
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;
}
Try it out . . .
Peddle intervals
Tip: You
can use
margin
property to add spaces directly to each page number:
CSS instance
margin: 0 4px; / * 0 is for top and bottom. F eel free to change it */
}
Try it out . . .
The peddle font size
We can use
font-size
property to set the font size of the page:
Center peddle
If you want to center the peddling, you can add the text-align:center style on the container element (e.g.
More instances
Breadcrumbs navigation
The other type of navigation is breadcrumb navigation, as follows:
CSS instance
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";
}
Try it out . . .