行内块元素的利用技巧 可以制作分页

本文探讨了如何利用CSS行内块元素的特性,巧妙地创建功能强大的分页系统。通过调整元素的布局和样式,可以实现灵活且响应式的分页效果,同时保持页面的整洁和易读性。
<!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>
        * {
            padding: 0px;
            margin: 0px;
        }

        .page {
            margin: 0 auto;
            width: 1025px;
            height: 100px;
            border: 1px solid #dedede;
            margin-top: 100px;
            text-align: center;
            line-height: 100px;
        }

        .page a {
            width: 60px;
            height: 50px;
            background-color: #f7f7f7;
            border: 1px solid #ccc;
            display: inline-block;
            margin-left: 5px;
            text-align: center;
            line-height: 50px;
            color: #333;
            text-decoration: none;

        }

        .page span {
            width: 60px;
            height: 50px;
            background-color: #fff;
            border: 1px solid #ccc;
            display: inline-block;
            margin-left: 5px;
            text-align: center;
            line-height: 50px;
            color: #333;
            text-decoration: none;

        }

        .page .pre,
        .page .next {
            width: 100px;
        }

        .page input {
            outline: none;
            width: 60px;
            height: 50px;
            border: 1px solid #ccc;

            display: inline-block;
        }

        .page .bt {

            width: 60px;
            height: 50px;
            border: 1px solid #ccc;

            background-color: #f7f7f7;
            display: inline-block;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div class="page">
        <a href="" class='pre'> &lt; &lt; 上一页</a>
        <a href="">第 2 页</a>
        <span> 第 3 页</span> <!-- 当前页码 不能点点击 所以用span -->
       <a href="">第 4 页</a>
        <a href="">第 5 页</a>
        <a href="">第 6 页</a>
        <a href="">第 7 页</a>
        <a href="">第 8 页</a>
        <a href="">第 9 页</a>
        <a href="">第 10 页</a>
        到第 <input type="text" name="" id=""> 页
        <input type="button" value="确定" class='bt'>
        <a href="" class='next'> 下一页 &gt; &gt;</a>
    </div>
</body>

</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值