Responsive Pagination
How do I make an responsive pagination?
What is a responsive pagination? How do you make a responsive pagination? This script and codes were developed by Torben Colding on 17 October 2022, Monday.
Responsive Pagination - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Responsive Pagination</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ * { transition: all .5s;
}
html { font-size: 62.5%;
}
body { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh;
}
h1 { font-size: 5rem; font-weight: bold; margin: 4rem 0; text-align: center;
}
.pagination,
.pagination ul { display: flex;
}
.pagination { justify-content: center;
}
.pagination li { background: #ddd; margin: .5rem; border-radius: 1rem; position: relative;
}
.pagination a { text-decoration: none; color: inherit; display: block; padding: 1rem 2rem; font-size: 3rem;
}
@media only screen and (max-width: 960px) { .pagination li:nth-child(2) { margin-right: 6rem; } .pagination li:nth-child(2) ~ li { display: none; } .pagination li:nth-last-child(3) ~ li { display: block; } .pagination li:nth-child(2):after { position: absolute; content: "..."; font-size: 3rem; top: 0; left: 7.5rem; }
}
@media only screen and (max-width: 720px) { html { font-size: 50%; } .previous a, .next a { text-indent: -5000px; overflow: hidden; background-position: center center; background-repeat: no-repeat; background-size: 100%; } .previous a { transform: rotate(180deg); background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/15891/ic_navigate_next_black_24px.svg); } .next a { background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/15891/ic_navigate_next_black_24px.svg); }
}
@media only screen and (max-width: 480px) { .pagination .pages { display: none; }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <h1>Responsive Pagination</h1>
<nav class="pagination"> <ul class="previous"> <li><a href="">Previous</a></li> </ul> <ul class="pages"> <li><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="">6</a></li> <li><a href="">7</a></li> <li><a href="">8</a></li> <li><a href="">9</a></li> <li><a href="">10</a></li> </ul> <ul class="next"> <li><a href="">Next</a></li> </ul>
</nav>
</body>
</html>
Responsive Pagination - Script Codes CSS Codes
* { transition: all .5s;
}
html { font-size: 62.5%;
}
body { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh;
}
h1 { font-size: 5rem; font-weight: bold; margin: 4rem 0; text-align: center;
}
.pagination,
.pagination ul { display: flex;
}
.pagination { justify-content: center;
}
.pagination li { background: #ddd; margin: .5rem; border-radius: 1rem; position: relative;
}
.pagination a { text-decoration: none; color: inherit; display: block; padding: 1rem 2rem; font-size: 3rem;
}
@media only screen and (max-width: 960px) { .pagination li:nth-child(2) { margin-right: 6rem; } .pagination li:nth-child(2) ~ li { display: none; } .pagination li:nth-last-child(3) ~ li { display: block; } .pagination li:nth-child(2):after { position: absolute; content: "..."; font-size: 3rem; top: 0; left: 7.5rem; }
}
@media only screen and (max-width: 720px) { html { font-size: 50%; } .previous a, .next a { text-indent: -5000px; overflow: hidden; background-position: center center; background-repeat: no-repeat; background-size: 100%; } .previous a { transform: rotate(180deg); background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/15891/ic_navigate_next_black_24px.svg); } .next a { background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/15891/ic_navigate_next_black_24px.svg); }
}
@media only screen and (max-width: 480px) { .pagination .pages { display: none; }
}
Developer | Torben Colding |
Username | torbencolding |
Uploaded | October 17, 2022 |
Rating | 3 |
Size | 3,503 Kb |
Views | 20,240 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
6 CSS Grid Layout Examples | 4,416 Kb |
Responsive HTML5 form elements with CSS Flexbox | 4,463 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Tab Menus | Zephyr | 3,180 Kb |
Display properties | Hamzaerbay | 1,886 Kb |
Static Image to Video Block | Grayghostvisuals | 4,864 Kb |
Alter bg opacity on hover... | Chrisboon27 | 2,054 Kb |
700 Synapses Per Second | Silentkrange | 2,138 Kb |
Coburg Banks SVG Logo | Mjtweaver | 3,875 Kb |
Ionic Infinite outside ion-content with ion-pane | Felquis | 3,117 Kb |
Splitted Layout | Hornebom | 2,162 Kb |
Headroom.js demo | WickyNilliams | 3,982 Kb |
Scarlett Johansson Tribute Page | Diomed | 3,233 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!