-
Notifications
You must be signed in to change notification settings - Fork 843
/
Copy pathpagination.html
113 lines (98 loc) · 3.11 KB
/
pagination.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS Cookbook: Pagination</title>
<link rel="stylesheet" href="styles.css">
<style>
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: auto;
margin: 0;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
white-space: nowrap;
}
nav {
border-top: 1px solid #eee;
margin-top: 1em;
padding-top: .5em;
}
.pagination a {
display: block;
padding: .5em 1em;
border: 1px solid #999;
border-radius: .2em;
text-decoration: none;
}
.pagination a[aria-current="page"] {
background-color: #333;
color: #fff;
}
</style>
<style class="editable">
nav {
display: flex;
justify-content: center;
}
.pagination {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}
.pagination li {
margin: 0 1px;
}
</style>
</head>
<body>
<section class="preview">
<nav aria-label="pagination">
<ul class="pagination">
<li><a href=""><span aria-hidden="true">«</span><span class="visuallyhidden">previous set of
pages</span></a></li>
<li><a href=""><span class="visuallyhidden">page </span>1</a></li>
<li><a href="" aria-current="page"><span class="visuallyhidden">page </span>2</a></li>
<li><a href=""><span class="visuallyhidden">page </span>3</a></li>
<li><a href=""><span class="visuallyhidden">page </span>4</a></li>
<li><a href=""><span class="visuallyhidden">next set of pages</span><span aria-hidden="true">»</span></a></li>
</ul>
</nav>
</section>
<textarea class="playable playable-css" style="height: 300px;">
nav {
display: flex;
justify-content: center;
}
.pagination {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}
.pagination li {
margin: 0 1px;
}
</textarea>
<textarea class="playable playable-html" style="height: 250px;">
<nav aria-label="pagination">
<ul class="pagination">
<li><a href=""><span aria-hidden="true">«</span><span class="visuallyhidden">previous set of pages</span></a></li>
<li><a href=""><span class="visuallyhidden">page </span>1</a></li>
<li><a href="" aria-current="page"><span class="visuallyhidden">page </span>2</a></li>
<li><a href=""><span class="visuallyhidden">page </span>3</a></li>
<li><a href=""><span class="visuallyhidden">page </span>4</a></li>
<li><a href=""><span class="visuallyhidden">next set of pages</span><span aria-hidden="true">»</span></a></li>
</ul>
</nav>
</textarea>
<div class="playable-buttons">
<input id="reset" type="button" value="Reset">
</div>
</body>
<script src="playable.js"></script>
</html>