html代码


<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>123</title> <style> ul.pagination { display: inline-block; list-style-type: none; /*padding: 0;*/ /*margin: 0;*/ } /*设置为内联标签 然后就变为横排了*/ ul.pagination li {display: inline;} ul.pagination li a { color: blue; /*float: left;*/ padding: 8px 16px; border: 1px solid black; border-radius: 10px; text-decoration: none; } ul.pagination li { margin-right:1em; } ul.pagination a:hover,ul.pagination a:focus { color: white; background-color: blue; } </style> </head> <body> <h2>简单的分页</h2> <ul class="pagination"> <li><a href="#">«</a></li> <li><a href="#">1</a></li> <li><a class="active" href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#">6</a></li> <li><a href="#">7</a></li> <li><a href="#">»</a></li> </ul> </body> </html>
效果:如下