<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;
margin-top: 2em;
padding: 0 0.5em;
background-color: #8BC34A;
}
.cp_navi .cp_pagenum {
font-size: 1em;
line-height: 2.5em;
display: block;
float: left;
padding: 0 25px;
transition: 400ms ease;
letter-spacing: 0.1em;
color: #ffffff;
}
.cp_navi .cp_pagenum:hover,
.cp_navi .cp_pagenum.current {
font-weight: bold;
color: #ffffff;
background-color: #C5E1A5;
}
.cp_navi .cp_pagenum.prev:hover,
.cp_navi .cp_pagenum.next:hover {
color: #C5E1A5;
background-color: transparent;
}
@media only screen and (max-width: 960px) {
.cp_navi .cp_pagination {
margin-top: 50px;
padding: 0 10px;
}
.cp_navi .cp_pagenum {
font-size: 0.8em;
line-height: 2.5em;
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;
}
}