前端

Bootstrap列表组、分页和进度条

2022-03-29  本文已影响0人  马佳乐

列表组

        <ul class="list-group">
            <li class="list-group-item active">列表组一</li>
            <li class="list-group-item">列表组二</li>
            <li class="list-group-item disabled">列表组三</li>
        </ul>
        <br />
        <div class="list-group list-group-flush">
            <a href="#" class="list-group-item active list-group-item-action">列表组一</a>
            <a href="#" class="list-group-item list-group-item-action">列表组二</a>
            <a href="#" class="list-group-item disabled list-group-item-action">列表组三</a>
        </div>
        <br />
        <ul class="list-group list-group-horizontal-sm">
            <li class="list-group-item active">列表组一</li>
            <li class="list-group-item list-group-item-danger">列表组二</li>
            <li class="list-group-item disabled">列表组三</li>
        </ul>
        <br />
        <ul class="list-group">
            <li class="list-group-item d-flex justify-content-between align-items-center">列表组一
            <span class="badge badge-danger">标记</span></li>
            <li class="list-group-item">列表组二</li>
            <li class="list-group-item disabled">列表组三</li>
        </ul>

分页

添加.pagination,字标签添加.page-item,链接标签添加.page-link
可添加.pagination-lg.pagination-sm设置大小分页效果
可添加.justify-content-*进行居中,居左,居右设置
代码练习:

        <ul class="pagination pagination-sm justify-content-center">
            <li class="page-item"><a href="#" class="page-link">首页</a></li>
            <li class="page-item"><a href="#" class="page-link">1</a></li>
            <li class="page-item"><a href="#" class="page-link">2</a></li>
            <li class="page-item"><a href="#" class="page-link">下一页</a></li>
        </ul>

进度条

        <div class="progress">
            <div class="progress-bar w-50 ">
            </div>
        </div>
        <br />
        <div class="progress" style="height: 30px;">
            <div class="progress-bar bg-danger" style="width: 35%;">
                30%
            </div>
        </div>
        <br>
        <div class="progress">
            <div class="progress-bar bg-success w-25"></div>
            <div class="progress-bar bg-danger w-25"></div>
            <div class="progress-bar bg-info w-25"></div>
        </div>
        <br />
        <div class="progress">
            <div class="progress-bar w-50 bg-info progress-bar-striped progress-bar-animated">
            </div>
        </div>
上一篇下一篇

猜你喜欢

热点阅读