Blogger Information
Blog 34
fans 0
comment 1
visits 23382
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Bootstrap导入与布局原理 —2018年9月20日23时45分
感恩的心的博客
Original
561 people have browsed it

1、将Bootstrap正确的引入到html文档中

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>bootstrap</title>
	<link rel="stylesheet" href="./lib/dist/css/bootstrap.css">
	<script src="./lib/jquery.js"></script>
	<script src="./lib/dist/js/bootstrap.js"></script>
</head>
<body>
	<div>
		<a href="" class="collapsing">Close.</a>
		<strong>Alert:</strong>Keep Attention!
	</div>
</body>
</html>

运行实例 »

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


2. 使用常见的组件,实现一个博客的首页布局

实例

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.css">
        <style>
            .grid {
                border: 1px solid #696969;
                border-radius: 5px;
                background-color: lightskyblue;
                min-height: 50px;
                text-align: center;
                line-height: 50px;
            }
        </style>
        <title>Bootstrap</title>
    </head>
    <body>
        <div class="container">
            <div class="col-md-12" >
                <nav class="navbar navbar-default">
                    <div class="container-fluid">
                        <!-- Brand and toggle get grouped for better mobile display -->
                        <div class="navbar-header">
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                                <span class="sr-only">Toggle navigation</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <a class="navbar-brand" href="#">浩然之气</a>
                        </div>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                            <ul class="nav navbar-nav">
                                <li class="active"><a href="#">链接<span class="sr-only">(current)</span></a></li>
                                <li><a href="#">链接</a></li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">分类 <span class="caret"></span></a>
                                    <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>
                                        <li role="separator" class="divider"></li>
                                        <li><a href="#">更多</a></li>
                                    </ul>
                                </li>
                            </ul>
                            <form class="navbar-form navbar-left">
                                <div class="form-group">
                                    <input type="text" class="form-control" placeholder="搜索">
                                </div>
                                <button type="submit" class="btn btn-default">提交</button>
                            </form>
                            <ul class="nav navbar-nav navbar-right">
                                <li><a href="#">链接</a></li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">分类 <span class="caret"></span></a>
                                    <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>
                                </li>
                            </ul>
                        </div><!-- /.navbar-collapse -->
                    </div><!-- /.container-fluid -->
                </nav>

            </div>

        </div>
        <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>	
    </body>
</html>

运行实例 »

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



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