功能:
1.点击页码,可实现跳转
2.输入页码,可实现跳转
3.点击上一页或下一页可实现跳转
完整代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>分页</title>
<style>
* {
margin: 0;
padding: 0;
}
.box {
margin: 100px 50px;
}
.nav {
display: inline-block;
}
.pageNum {
box-sizing: border-box;
padding: 5px;
width: 30px;
height: 28px;
line-height: 28px;
text-align: center;
}
.pre,
.next,
.go {
width: 46px;