代碼如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>翻頁(yè)</title>
<style type="text/css">
.page{
width: 960px;
height: 42px;
margin: 100px auto;
border: 1px #E7E7E7 solid;
}
.page1{
width: 450px;
margin: 8px auto;
}
a{
text-align: center;
text-decoration: none;
display: inline-block;
background-color: gold;
font: 12px 微軟雅黑;
color: #000;
padding: 5px 11px;
}
a:hover{
color: #dd992d;
}
</style>
</head>
<body>
<div class="page">
<div class="page1">
<a href="#" class="button">上一頁(yè)</a>
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
<a href="#">4</a>
<span>...</span>
<a href="#">17</a>
<a href="#">18</a>
<a href="#">19</a>
<a href="#">20</a>
<a href="#" class="button">下一頁(yè)</a>
</div>
</div>
</body>
</html>
效果圖