zoukankan      html  css  js  c++  java
  • Bootstrap -- 导航栏样式、分页样式、标签样式、徽章样式

    Bootstrap -- 导航栏样式、分页样式、标签样式、徽章样式

    1. 使用图标的导航栏

    使用导航栏样式:

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>My Test bootstrap</title>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
        <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
        <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
    <body>            
        <nav class="navbar navbar-default" role="navigation"> 
            <div class="container-fluid"> 
                <div class="navbar-header"> 
                    <a class="navbar-brand" href="#">Test Bootstrap</a> 
                </div> 
                <ul class="nav navbar-nav navbar-right"> 
                    <li><a href="#"><span class="glyphicon glyphicon-user"></span> 注册</a></li> 
                    <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> 登录</a></li> 
                </ul> 
            </div> 
        </nav>
    </body>
    </html>
    View Code

    样式效果:

    2. 分页(Pagination):  是一种无序列表,Bootstrap 像处理其他界面元素一样处理分页。

    使用分页样式:

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>My Test bootstrap</title>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
        <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
        <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
    <body>            
        <ul class="pagination">
            <li><a href="#">&laquo;</a></li>
            <li class="active"><a href="#">1</a></li>
            <li><a href="#">2</a></li>
            <li><a href="#">3</a></li>
            <li><a href="#">4</a></li>
            <li><a href="#">5</a></li>
            <li><a href="#">6</a></li>
            <li><a href="#">&raquo;</a></li>
        </ul>
    </body>
    </html>
    View Code

    样式效果:

    3. 标签样式

    使用样式:

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>My Test bootstrap</title>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
        <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
        <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
    <body>            
        <span class="label label-default">默认标签</span>
        <span class="label label-primary">主要标签</span>
        <span class="label label-success">成功标签</span>
        <span class="label label-info">信息标签</span>
        <span class="label label-warning">警告标签</span>
        <span class="label label-danger">危险标签</span>
    </body>
    </html>
    View Code

    样式效果:

    4. 徽章(Badges):主要用于突出显示新的或未读的项。如需使用徽章,只需要把 <span class="badge"> 添加到链接、Bootstrap 导航等这些元素上即可。

    使用徽章样式:

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>My Test bootstrap</title>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
        <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
        <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
    <body>            
        <ul class="nav nav-pills">
            <li class="active">
                <a href="#">首页
                    <span class="badge">42</span>
                </a>
            </li>
            <li>
                <a href="#">动态</a>
            </li>
            <li>
                <a href="#">留言</a>
            </li>
            <li>
                <a href="#">消息
                    <span class="badge">3</span>
                </a>
            </li>
        </ul>
    </body>
    </html>
    View Code

    样式效果:

  • 相关阅读:
    基于javascript引擎封装实现算术表达式计算工具类
    Windows 服务入门指南
    参数化查询为什么能够防止SQL注入
    Control 的DraggerHelper, 拖动控件从此变得很简单。。。
    书籍推荐记这几年看的书
    使用“using” 的 “Cursor”
    多线程,silverlight_Rest_WCF,dynamic 索引帖
    关于静态事件 static event 的二三事
    探讨 .NET 4 新增的 SortedSet 类
    我们需要莱特希尔报告
  • 原文地址:https://www.cnblogs.com/ChengWenHao/p/BootstrapPart7.html
Copyright © 2011-2022 走看看