Home > Article > Web Front-end > Pagination implementation method in css (complete code)
The content of this article is about the paging implementation method in CSS (complete code). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Code:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>分页演练</title> <style> .box{ width:980px; margin:auto; text-align:center;} ul{ list-style:none; display:inline-block;/*因为ul是块级元素,内容的inline-block+盒子的text-align设置水平居中!否则,text-align无效*/ padding:0;/*去掉默认的内外边距!*/ margin:0; } li{ float:left; } a{ text-decoration:none; padding:8px 16px; border:1px solid #e8e8e8; border-radius:5px;} a:hover{ background-color:#e8e8e8; } </style> </head> <body> <p class="box"> <ul class="nav"> <li><<</li> <li><a href="#1" id="link-1">1</a></li> <li><a href="#2" id="link-2" class="active">2</a></li> <li><a href="#3" id="link-3">3</a></li> <li><a href="#4" id="link-4">4</a></li> <li><a href="#5" id="link-5">5</a></li> <li><a href="#6" id="link-6">6</a></li> <li><a href="#7" id="link-7">7</a></li> <li><a href="#8" id="link-8">8</a></li> <li>>></li> </ul> </p> </body> </html>
Run result:
##Related recommendations:Ordered list ol beautiful css paging style code (pure css)_link special effects
The above is the detailed content of Pagination implementation method in css (complete code). For more information, please follow other related articles on the PHP Chinese website!