CSS Pagination Discover how to use CSS to design a pagination that is responsive. Simple Pagination If your website has a lot of pages, you might want to add pagination to each one of them: Example .pagination { display: inline-block; } .pagination a { color: black; float: left; padding: 8px 16px; text-decoration: none; } Active and Hoverable Pagination With a .active class to highlight the current page, you can use the hover selector to alter the color of each page link as you move the mouse over it: Example .pagination a.active { background-color: #4CAF50; color: white; } .pagination a:hover:not(.active) {background-color: #ddd;} Rounded Active and Hoverable Buttons Add the border-radius property if you want a rounded “active” and “hover” button: Example .pagination a { border-radius: 5px; } .pagination a.active { border-radius: 5px; } Hoverable Transition Effect To add a transition effect when the page links are hovered over, add the transition attribute to them: Example .pagination a { transition: background-color .3s; } Bordered Pagination To add borders to the pagination, use the border property: Example .pagination a { border: 1px solid #ddd; /* Gray */ } Rounded Borders Advice: Give your first and last links in the pagination rounded borders. Example .pagination a:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; } .pagination a:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; } Space Between Links Advice: If you would prefer not to group the page links, add the margin property: Example .pagination a { margin: 0 4px; /* 0 is for top and bottom. Feel free to change it */ } Pagination Size Use the font-size attribute to alter the pagination’s size: Example .pagination a { font-size: 22px; } Centered Pagination Use text-align:center to encircle a container element (such as <div>) to center the pagination. Example .center { text-align: center; } More Examples Example Breadcrumbs ----Example mukava---- Another variation of pagination is so-called “breadcrumbs”: Example 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"; } Tagged:CSS