分页代码

浏览7769

<style>

    .moonaaa{width: 100%; margin: auto !important;}

    .moonaaa .nav{width: 100%;height: 40px;;}

    .moonaaa li{width: 50px;height: 30px;float: left;margin-left: 2.3%;font-size: 16px;text-align: center;list-style: none;border: 1px solid #ccc;line-height: 31px;}

    .moonaaa li a{color: #333;text-decoration:none;}

    .active{background: #0096ff !important;color: #fff}

    .active span{color: #fff}

    .agination{display: inline-block}

</style>

<div class="moonaaa">

    <{if $page}>

    <nav style="margin-bottom: 1%;text-align: center;width:100%; margin: 20px 0 40px 0">

        <ul class="pagination w_ym_box am-cf" style=" display: block;margin: 0 auto;width: 90%">

            <li><a target="_self" class="w_ym_sy"  href="<{url c="$m/$c" a="$a"}>?<{get_fenye_filed('p')}>&p=<{$page.first_page}>" aria-label="Previous" title="首页"><span aria-hidden="true">首页</span></a></li>

            <li><a target="_self"  href="<{url c="$m/$c" a="$a"}>?<{get_fenye_filed('p')}>&p=<{$page.prev_page}>" aria-label="Previous"><span aria-hidden="true">上一页</span></a></li>

            <{foreach $page.all_pages as $p}>

            <li style="width: 31px!important;" <{if $p == $page.current_page}> class="active btn-primary"<{/if}>><a target="_self" href="<{url c="$m/$c" a="$a"}>?<{get_fenye_filed('p')}>&p=<{$p}>" aria-label="Previous"><span aria-hidden="true"><{$p}></span></a></li>

            <{/foreach}>

            <li ><a  target="_self"  href="<{url c="$m/$c" a="$a" }>?<{get_fenye_filed('p')}>&p=<{$page.next_page}>" aria-label="Previous"><span aria-hidden="true">下一页</span></a></li>

            <li ><a  target="_self"  href="<{url c="$m/$c" a="$a" }>?<{get_fenye_filed('p')}>&p=<{$page.last_page}>" title="尾页"><span class="sr-only">尾页</span></a></li>

        </ul>

    </nav>

    <{/if}>

</div>


下载 演示

  • 暂无任何回答