Blogger Information
Blog 34
fans 0
comment 1
visits 23066
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Bootstrap的按钮与下拉菜单 —2018年9月26日23时45分
感恩的心的博客
Original
632 people have browsed it

1、编写一个标准的下拉菜单,要求对data-属性有较深的理解

实例

<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.css">
        <script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
        <script src="http://apps.bdimg.com/libs/bootstrap/3.2.0/js/bootstrap.js"></script>
        <title>Document</title>
    </head>
    <body>
        <div class="dropdown" style="margin-top: 200px">
            <button type="button" class="btn btn-default" data-toggle="dropdown">
                前端开发
                <span class="caret"></span>            
            </button>
            <ul class="dropdown-menu">
                <li class="dropdown-header">圣贤教育</li>
                <li><a href="">儒学</a></li>
                <li><a href="">道家</a></li>
                <li><a href="">佛家</a></li>
                <li class="divider"></li>
                <li><a href="">净土</a></li>
                <li><a href="">禅宗</a></li>
            </ul>

            
        </div>

    </body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

2、使用按钮组编写一个分裂式下拉菜单

实例

<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.css">
        <script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
        <script src="http://apps.bdimg.com/libs/bootstrap/3.2.0/js/bootstrap.js"></script>
        <title>Document</title>
    </head>
    <body>
        <div class="btn-group">
            <button type="button" class="btn btn-success">感恩的心</button>
            <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="caret"></span>
                <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu">
                <li><a href="#">布施</a></li>
                <li><a href="#">爱语</a></li>
                <li><a href="#">利行</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="#">同事</a></li>
            </ul>
        </div>
    </body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!