I want to make a responsive pagination widget.
Designing one seems easy enough but I'm stuck on making it
responsive. So far, the HTML is
and the CSS is
How do I get only those "pages" that can fit in the available space
appear (with <a href="a">...</a> if there are hidden pages)?
Especially as the width of #paginationvaries.
Is this something I need to use JavaScript for?
I want to make a responsive pagination widget.
Designing one seems easy enough but I'm stuck on making it responsive.
So far, the HTML is
<div id="pagination">
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
...
</div>
and the CSS is
#pagination {
width: 40%;
}
a {
display: block;
...
}
How do I get only those "pages" that can fit in the available space
appear (with <a href="a">...</a> if there are hidden pages)? Especially
as the width of #pagination varies.
Is this something I need to use JavaScript for?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 75:56:30 |
Calls: | 6,657 |
Calls today: | 3 |
Files: | 12,203 |
Messages: | 5,332,730 |
Posted today: | 1 |