<ul class="pager"> <li class="pager-current first">1</li> <li class="pager-item"><a title="2ページへ" href="/articles?page=1">2</a></li> <li class="pager-item"><a title="3ページへ" href="/articles?page=2">3</a></li> <li class="pager-item"><a title="4ページへ" href="/articles?page=3">4</a></li> <li class="pager-item"><a title="5ページへ" href="/articles?page=4">5</a></li> <li class="pager-item"><a title="6ページへ" href="/articles?page=5">6</a></li> <li class="pager-item"><a title="7ページへ" href="/articles?page=6">7</a></li> <li class="pager-item"><a title="8ページへ" href="/articles?page=7">8</a></li> <li class="pager-item"><a title="9ページへ" href="/articles?page=8">9</a></li> <li class="pager-ellipsis">…</li> <li class="pager-next"><a href="/articles?page=1">次</a></li> <li class="pager-last last"><a href="/articles?page=10">最終</a></li> </ul>
li.pager-last a:after{ content:"\f050"; font-family: "FontAwesome"; display: inline-block; position:absolute; -webkit-transform: translate(-30px, -42px); transform: translate(-30px, -42px); -webkit-transition: transform 0.3s ease-in-out; transition: transform 0.3s ease-in-out; }
.pager li.pager-last a{ transform: translateY(100%) ; transition: transform 0.3s ease-in-out; }
.pager li.pager-last:hover a{ transform: translateY(0) ; transition: transform 0.3s ease-in-out; }
.pager li { overflow: hidden; }
ページャー要素外非表示より、矢印とアンカー文字をマウスオーバー時に非表示することができるようになります
<style type="text/css"> .pager li { margin-right: 4px; border: 1px solid #ccc; padding: 0; display: inline-block; border-radius: 4px; overflow: hidden; } .pager li a{ padding:0.5em; font-size:18px; border-radius: 4px; text-decoration:none; display:inline-block; } .pager li.pager-last a:after{ content:"\f050"; font-family: "FontAwesome"; display: inline-bloc; position:absolute; -webkit-transform: translate(-30px, -42px); transform: translate(-30px, -42px); -webkit-transition: transform 0.3s ease-in-out; transition: transform 0.3s ease-in-out; } .pager li.pager-last a{ transform: translateY(100%) ; transition: transform 0.3s ease-in-out; color:#2e70b1; } .pager li.pager-last:hover a{ transform: translateY(0) ; transition: transform 0.3s ease-in-out; } </style> <ul class="pager"> <li class="pager-last last"><a href="#">最終</a></li> </ul>