<nav class="cp_navi">
<div class="cp_pagination">
<a class="cp_pagenum prev" href="#">prev</a>
<span aria-current="page" class="cp_pagenum current">1</span>
<a class="cp_pagenum" href="#">2</a>
<a class="cp_pagenum" href="#">3</a>
<a class="cp_pagenum" href="#">4</a>
<a class="cp_pagenum" href="#">5</a>
<a class="cp_pagenum" href="#">6</a>
<a class="cp_pagenum" href="#">7</a>
<a class="cp_pagenum" href="#">8</a>
<a class="cp_pagenum" href="#">9</a>
<a class="cp_pagenum" href="#">10</a>
<a class="cp_pagenum next" href="#">next</a>
</div>
</nav>
nav.cp_navi *, nav.cp_navi *:after, nav.cp_navi *:before {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
nav.cp_navi a {
text-decoration: none;
}
nav.cp_navi {
margin: 2em 0;
text-align: center;
}
.cp_navi .cp_pagination {
display: inline-block;
height: 70px;
margin-top: 2em;
padding: 0 25px;
border-radius: 35px;
background-color: #eeeeee;
}
.cp_navi .cp_pagenum {
font-size: 1.2em;
line-height: 70px;
display: block;
float: left;
padding: 0 25px;
transition: 400ms ease;
letter-spacing: 0.1em;
color: #595959;
}
.cp_navi .cp_pagenum:hover,
.cp_navi .cp_pagenum.current {
color: #ffffff;
background-color: #00BCD4;
}
.cp_navi .cp_pagenum.prev:hover,
.cp_navi .cp_pagenum.next:hover {
color: #00BCD4;
background-color: transparent;
}
@media only screen and (max-width: 960px) {
.cp_navi .cp_pagination {
height: 50px;
margin-top: 50px;
padding: 0 10px;
border-radius: 25px;
}
.cp_navi .cp_pagenum {
font-size: 0.8em;
line-height: 50px;
padding: 0 15px;
}
.cp_navi .cp_pagenum.prev,
.cp_navi .cp_pagenum.next {
padding: 0 10px;
}
}
@media only screen and (min-width: 120px) and (max-width: 767px) {
.cp_navi .cp_pagenum {
display: none;
padding: 0 14px;
}
.cp_navi .cp_pagenum:nth-of-type(2) {
position: relative;
padding-right: 50px;
}
.cp_navi .cp_pagenum:nth-of-type(2)::after {
font-size: 1.2em;
position: absolute;
top: 0;
left: 45px;
content: '...';
}
.cp_navi .cp_pagenum:nth-child(-n+3),
.cp_navi .cp_pagenum:nth-last-child(-n+3) {
display: block;
}
.cp_navi .cp_pagenum:nth-last-child(-n+4) {
padding-right: 14px;
}
.cp_navi .cp_pagenum:nth-last-child(-n+4)::after {
content: none;
}
.cp_navi .cp_pagenum.prev,
.cp_navi .cp_pagenum.next {
padding: 0 5px;
}
}