制作特征布局—翻页(盒模型,内联元素)

2018-09-11  本文已影响0人  沙子_32c6

代码:

    <!DOCTYPE html>
    <html lang="en">
    <head>
<meta charset="UTF-8">
<title>翻页布局</title>
<style type="text/css">
    *{
        padding:0px;
        margin:0px;
    }

    .box{
        width:958px;
        height:40px;
        border:1px gray solid;
        margin:0 auto;
    }
    a{
        display:inline-block;
        padding:5px 10px;
        margin:0 auto;
        background-color:gold;
        font-family: 微软雅黑;
        font-size:12px;
        color:black;
        position:relative;
        text-decoration:none;
        left:244px;
        top:5px;
    }
    span{
        display: inline-block;
        padding:5px 10px;
        margin:0 auto;
        background-color:white;
        font-family: 微软雅黑;
        font-size:12px;
        color:black;
        position:relative;
        text-decoration:none;
        left:244px;
        top:5px;
    }
    a:hover{
        color: red;
    }

</style>
</head>
 <body>
<div class="box">
    <a href="#">上一页</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="#">下一页</a>
</div>
    </body>
    </html>

效果如图:


选区_036.png
上一篇 下一篇

猜你喜欢

热点阅读