bootstrap
现成的css样式,直接调用类
作用是快速写出页面
又称UI框架
Bootstrap中文网
LESS是预处理器
CSS预处理器定义了一种新的语言,基本的思想是用一种专门的编程语言,开发者只需要使用这种语言进行编码工作,减少枯燥无味的CSS代码的编写过程的同时,它能让你的CSS具备更加简洁、适应性更强、可读性更加、层级关系更加明显、更易于代码的维护等诸多好处。
下载bootstrap3.3.7
bootstrap自带响应式布局==》手机 电脑呈现不同的样式
渲染分辨率:
物理分辨率:
meta:vp
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> ==》让手机浏览器不缩放
content:内容 自适应宽度
媒体查询 @media
需要再自定义css 当符合一个条件,需要重新定义该条件的css。
栅格系统把父元素分成12份 col-xs-6占一半
类名重复会覆盖 可以重新定义
class = "" 里面没有语义,只是单纯的设置格式如颜色等。
表单
label 获取焦点
class = "form-control"
class = "form-group"
class = control-label 控制向右对齐
span (current) 给阅读器看的。人文关怀,
1 UI框架
包含 CSS、JS特效插件 的工具集,快速开发网页
经典的UI框架: BootStrap、JQueryUI、MeiziUI(AmazeUI)......
2 BootStrap
2.1 版本
用于生产环境 (CSS\JavaScript)
源码(LESS) (LESS是CSS预处理器)
SASS (SASS也是CSS预处理)
<!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">
<title>Bootstrap演示</title>
<link rel="stylesheet" href="dist/css/bootstrap.css">
<style>
/*[class*="col-"]
选择所有类名中含有"col-"的元素*/
[class*='col-'] {
border:1px solid #ccc;
background: #f5f5f5;
}
</style>
</head>
<body> <div class="container">
<div class="page-header">
<h1>同志交友 <small>全国最大的交友平台</small> </h1>
</div> <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="#">Brand</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="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!-- -->
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
</div> </div> <!--导入jquery-->
<script src="dist/js/jquery-3.3.1.js"></script>
<script src="dist/js/bootstrap.js"></script>
</body>
</html>
Bootstrap
3 响应式布局
3.1 手机屏幕的分辨率
现在绝大部分 手机 视网膜屏幕, 有物理分辨率,和 渲染分辨率。 iphone8
750*1334
渲染分辨率:375*667
手机浏览器 为了让 没有做响应式处理的网页能够正常显示, 自动进行缩放。视口的大小通常会设置为 980px
3.2 媒体查询
@media (min-width:) {
选择器 {
}
选择器 {
}
}
媒体特效:
min-width
min-height
max-width
max-height
width
height
.........
<!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">
<title>媒体查询</title>
<style>
body {
margin:0;
} /*默认 <768px 手机 */
.container {
margin:0 auto;
width:100%;
height:400px;
text-align: center;
background: pink;
} /*媒体查询*/ /* >= 768 < 992 小屏幕 平板 */
@media (min-width:768px) {
.container {
width:750px;
}
.row { }
} /* >=992 <1200 中等屏幕 */
@media (min-width:992px) {
.container {
width: 970px;
}
} /*>=1200 大屏幕*/
@media (min-width:1200px) {
.container {
width: 1170px;
}
}
</style>
</head>
<body>
<div class="container">
<h1>媒体查询</h1>
</div>
</body>
</html>
媒体查询
3.3 视口
<meta name="viewport" content="width=device-width,initial-scale=1.0">
4 布局
4.1 栅格系统
.container
<768px 100% 超小屏幕 xs
>=768px <992px 750px 小屏幕 sm
>=992px < 1200px 970px 中等屏幕 md
>=1200px 1170px 大屏幕 lg
<!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">
<title>Bootstrap演示</title>
<link rel="stylesheet" href="dist/css/bootstrap.css">
<style>
[class*='col-'] {
border:1px solid #ccc;
background: #f5f5f5;
padding:20px;
}
.row {
margin-bottom:20px;
}
</style>
</head>
<body>
<!-- 固定布局样式 class = 'container' -->
<div class="container">
<div class="page-header">
<h1>栅格系统</h1>
</div> <div class="row">
<div class="col-xs-6">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reiciendis, nihil dolore eveniet eaque itaque asperiores natus nostrum velit nisi similique inventore nesciunt impedit voluptates officia, perferendis omnis alias, hic harum?</div> <div class="col-xs-6">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit, illo quia delectus tempore eius officiis facilis nihil veritatis culpa et blanditiis ducimus adipisci deserunt perferendis, magni officia quidem, fugit tempora!</div>
</div> <div class="row">
<div class="col-md-4">Lorem ipsum dolor sit amet.</div>
<div class="col-md-8">HELLO</div>
</div> <div class="row">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">Lorem ipsum dolor sit amet.</div>
</div> <div class="row">
<div class="col-sm-6 col-md-3">Lorem ipsum dolor sit amet.</div>
<div class="col-sm-6 col-md-3">Lorem ipsum dolor sit amet.</div>
<div class="col-sm-6 col-md-3">Lorem ipsum dolor sit amet.</div>
<div class="col-sm-6 col-md-3">Lorem ipsum dolor sit amet.</div>
</div> <div class="row">
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="col-md-2">Lorem ipsum dolor sit amet.</div>
<div class="col-md-2">Lorem ipsum dolor sit amet.</div>
<div class="col-md-2">Lorem ipsum dolor sit amet.</div>
<div class="col-md-2">Lorem ipsum dolor sit amet.</div>
<div class="col-md-2">Lorem ipsum dolor sit amet.</div>
<div class="col-md-2">Lorem ipsum dolor sit amet.</div>
</div>
</div> <div class="row">
<div class="col-md-4 col-md-offset-2">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae blanditiis, commodi! Sit corporis aliquid tempora, hic illum. Eaque recusandae aspernatur deserunt necessitatibus minima eligendi, sapiente nihil, eos deleniti modi ea?</div>
</div> <div class="row">
<div class="col-md-6">
<pre>Lorem ipsum dolor sit amet,
consectetur adipisicing elit. Numquam quasi modi totam deleniti hic debitis quisquam saepe, nulla fugit,
porro rem obcaecati fugiat magnam,
repellendus! Accusantium veritatis dolore qui aperiam.</pre>
</div>
</div> </div> <!--导入jquery-->
<script src="dist/js/jquery-3.3.1.js"></script>
<script src="dist/js/bootstrap.js"></script>
</body>
</html>
Bootstrap栅格系统
行和列
行 .row
列 col-xs-* col-sm-* col-md-* col-lg-*
把父元素分成12份,指定几份
4.2 表格
.table
.table-striped
.table-bordered
.table-hover
.table-condensed
.success .info .danger .warning .active
<!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">
<title>Bootstrap演示</title>
<link rel="stylesheet" href="dist/css/bootstrap.css">
<style> </style>
</head>
<body> <div class="container-fluid">
<div class="page-header">
<h1>表格</h1>
</div>
<div class="row">
<div class="col-md-6">
<table class="table table-bordered table-hover ">
<thead>
<tr class="success">
<th>序号</th>
<th>姓名</th>
<th>年龄</th>
<th>性别</th>
<th>爱好</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>曹操</td>
<td>18</td>
<td>男</td>
<td>人妻</td>
</tr>
<!-- 控制不同的背景颜色 -->
<tr class="active">
<td>1</td>
<td>曹操</td>
<td>18</td>
<td class="danger">男</td>
<td>人妻</td>
</tr>
<tr class="danger">
<td>1</td>
<td>曹操</td>
<td>18</td>
<td>男</td>
<td>人妻</td>
</tr>
<tr class="warning">
<td>1</td>
<td>曹操</td>
<td>18</td>
<td>男</td>
<td>人妻</td>
</tr>
<tr class="info">
<td>1</td>
<td>曹操</td>
<td>18</td>
<td>男</td>
<td>人妻</td>
</tr>
<tr>
<td>1</td>
<td>曹操</td>
<td>18</td>
<td>男</td>
<td>人妻</td>
</tr>
<tr>
<td>1</td>
<td>曹操</td>
<td>18</td>
<td>男</td>
<td>人妻</td>
</tr>
<!-- 只识别第一个 -->
<tr class = "danger warning info">
<td>1</td>
<td>曹操</td>
<td>18</td>
<td>男</td>
<td>人妻</td>
</tr>
<tr>
<td>1</td>
<td>曹操</td>
<td>18</td>
<td>男</td>
<td>人妻</td>
</tr>
</tbody>
</table>
</div>
</div>
</div> </body>
</html>
BootStrap表格
4.3 表单
.form-horizontal
.from-group
.form-control
.control-label
<!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">
<title>Bootstrap演示</title>
<!-- 导入bootstrap css样式 -->
<link rel="stylesheet" href="dist/css/bootstrap.css">
<style> </style>
</head>
<body> <div class="container-fluid">
<div class="page-header">
<h1 class="text-center">表单</h1>
</div> <div class="row">
<div class="col-md-4 col-md-offset-4">
<form action="#" class="">
<div class="form-group">
<!-- lable for 仅仅是为了点在文字上获得焦点 -->
<label for="userInput">用户名:</label>
<input type="text" class="form-control" name="username" id="userInput">
</div> <div class="form-group">
<label for="">密码:</label>
<input type="password" name="pwd" id="pwdInput" class="form-control">
</div> <div class="checkbox">
<label>
<input type="checkbox" name="" id=""> 记住我
</label>
</div> <button class="btn btn-default btn-block">登 录</button>
</form>
</div>
</div> <hr> <div class="row">
<div class="col-md-4 col-md-offset-4">
<form action="#" class="form-horizontal">
<div class="form-group">
<label for="userInput" class="col-md-4 control-label">用户名:</label>
<div class="col-md-8">
<input type="text" class="form-control" name="username" id="userInput">
</div>
</div> <div class="form-group">
<label for="" class="col-md-4 control-label">密码:</label>
<div class="col-md-8">
<input type="password" name="pwd" id="pwdInput" class="form-control">
</div> </div> <div class="form-group">
<div class="col-md-8 col-md-offset-4">
<div class="checkbox">
<label>
<input type="checkbox" name="" id=""> 记住我
</label>
</div>
</div>
</div> <div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button class="btn btn-default">登 录</button>
</div>
</div> </form>
</div>
</div>
</div> </body>
</html>
Bootstrap表单
4.4 其他
<!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">
<title>Bootstrap演示</title>
<link rel="stylesheet" href="dist/css/bootstrap.css">
<style>
.row {
margin-bottom: 40px;
}
img {
border:1px solid #ccc;
}
</style>
</head>
<body> <div class="container-fluid">
<div class="page-header">
<h1>按钮</h1>
</div> <div class="row">
<div class="col-md-12">
<button class="btn btn-default">按钮</button>
<button class="btn btn-info">按钮</button>
<button class="btn btn-success">按钮</button>
<button class="btn btn-warning">按钮</button>
<button class="btn btn-danger">按钮</button>
<button class="btn btn-primary">按钮</button>
</div> <div class="col-md-4"> <button class="btn btn-primary btn-lg">按钮</button>
<button class="btn btn-primary">按钮</button>
<button class="btn btn-primary btn-sm">按钮</button> <button class="btn btn-primary btn-block">按钮</button>
</div>
</div> <div class="row">
<img src="data:images/product01.jpg" alt="">
<img src="data:images/product01.jpg" alt="" class="img-rounded">
<img src="data:images/product01.jpg" alt="" class="img-circle">
<img src="data:images/product01.jpg" alt="" class="img-thumbnail">
</div> </div> </body>
</html>
按钮
5 组件
<!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">
<title>Bootstrap演示</title>
<link rel="stylesheet" href="dist/css/bootstrap.css">
<style>
.row {
margin-bottom:40px;
}
</style>
</head>
<body> <div class="container-fluid">
<div class="page-header">
<h1 class="text-center">表单</h1>
</div> <div class="row">
<div class="col-md-12">
<p class="text-danger">
<i class="glyphicon glyphicon-home"></i>
</p> <p class="" style="color:red;font-size:100px">
<i class="glyphicon glyphicon-home"></i>
</p> <button class="btn btn-default">
<i class="glyphicon glyphicon-ok"></i>
</button> <a href="#" class="btn btn-primary">
<i class="glyphicon glyphicon-lock"></i>
</a>
</div>
</div>
</div> </body>
</html>
Bootstrap组件
6 插件
<!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">
<title>Bootstrap演示</title>
<link rel="stylesheet" href="dist/css/bootstrap.css">
<style>
.navbar-tongzhi {
margin-bottom: 0;
}
.jumbotron-tongzhi {
background: url('../../dist/images_one/meinv02.jpg') no-repeat 0 0/cover;
color:#fff;
}
.footer-tongzhi {
padding: 40px 0px 20px;
background: #333;
color: #eee;
}
.footer-links {
margin-bottom:20px;
}
.footer-links a {
margin-right:20px;
color: #fff;
}
.carousel-tongzhi img{
width:100%;
}
</style>
</head>
<body>
<nav class="navbar navbar-default navbar-inverse navbar-static-top navbar-tongzhi">
<div class="container">
<!-- 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="#">主页</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="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
<!-- 分割线 -->
<li role="separator" class="divider"></li>
<li><a href="#">Python</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Linux</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left">
<div class="input-group">
<input type="text" class="form-control" placeholder="搜索">
<span class="input-group-btn">
<button class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>
</button>
</span>
</div> </form>
<a href="#" class="btn btn-primary navbar-btn navbar-right">
<i class="glyphicon glyphicon-shopping-cart"></i>
<span class="badge">42</span>
</a>
<ul class="nav navbar-nav navbar-right">
<li><a href="JavaScript:void(0)" data-toggle="modal" data-target="#myModal">登录</a></li>
<li><a>注册</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav> <!-- <div class="jumbotron jumbotron-tongzhi">
<div class="container">
<h1>Hello, 同志!</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe, ducimus provident laborum. Ullam maiores, illum blanditiis odit ratione natus deleniti dolorem veniam, nobis voluptas pariatur aut iste quam soluta recusandae?</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">更多同志</a></p>
</div>
</div> --> <div id="carousel-example-generic" class="carousel slide carousel-tongzhi">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol> <!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="data:images/play01.jpg" alt="...">
<div class="carousel-caption">
<h3>最好的同志手机</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloribus nostrum impedit deserunt illo reprehenderit aspernatur atque mollitia voluptatibus iure nobis commodi, dolorem molestias nisi optio tenetur tempora facere consequatur ratione.
</p>
</div>
</div>
<div class="item">
<img src="data:images/play02.jpg" alt="...">
<div class="carousel-caption"> </div>
</div> <div class="item">
<img src="data:images/play03.jpg" alt="...">
<div class="carousel-caption"> </div>
</div> <div class="item">
<img src="data:images/play04.jpg" alt="...">
<div class="carousel-caption"> </div>
</div> </div> <!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div> <div class="container">
<ol class="breadcrumb">
<li><a href="#">首页</a></li>
<li><a href="#">同志商城</a></li>
<li class="active">商品列表</li>
</ol>
</div> <div class="product-wrapper">
<div class="container">
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div>
</div> <nav aria-label="Page navigation">
<ul class="pagination">
<li>
<a href="#" aria-label="Previous">
<span aria-hidden="true">上一页</span>
</a>
</li>
<li><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="#" aria-label="Next">
<span aria-hidden="true">下一页</span>
</a>
</li>
</ul>
</nav>
</div>
</div> <div class="footer-tongzhi">
<div class="container">
<div class="row footer-links">
<div class="col-md-12">
<a href="#">GitHub</a>
<a href="#">GitHub</a>
<a href="#">同志 交友</a>
<a href="#">GitHub</a>
<a href="#">GitHub</a>
</div>
</div> <div class="row">
<div class="col-md-12">
<p>Designed and built with all the love in the world by @mdo and @fat. Maintained by the core team with the help of our contributors.</p>
<p>本项目源码受 MIT开源协议保护,文档受 CC BY 3.0 开源协议保护。</p>
</div>
</div>
</div>
</div> <!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">登录同志交友平台</h4>
</div>
<div class="modal-body">
<form action="#" class="">
<div class="form-group">
<label for="userInput">用户名:</label>
<input type="text" class="form-control" name="username" id="userInput">
</div> <div class="form-group">
<label for="">密码:</label>
<input type="password" name="pwd" id="pwdInput" class="form-control">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary">登录</button>
</div>
</div>
</div>
</div> <!--导入jquery-->
<script src="dist/js/jquery-3.3.1.js"></script>
<script src="dist/js/bootstrap.js"></script>
<script>
$(function(){
$('#carousel-example-generic').carousel({
interval: 1000
})
})
</script>
</body>
</html>
未加入主题页面
<!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">
<title>Bootstrap演示</title>
<link rel="stylesheet" href="dist/css/bootstrap.css">
<!-- <link rel="stylesheet" href="bootstrap-yeit.css"> -->
<style>
.navbar-tongzhi {
margin-bottom: 0;
}
.jumbotron-tongzhi {
background: url('../../dist/images_one/meinv02.jpg') no-repeat 0 0/cover;
color:#fff;
}
.footer-tongzhi {
padding: 40px 0px 20px;
background: #333;
color: #eee;
}
.footer-links {
margin-bottom:20px;
}
.footer-links a {
margin-right:20px;
color: #fff;
}
.carousel-tongzhi img{
width:100%;
}
</style>
</head>
<body>
<nav class="navbar navbar-default navbar-inverse navbar-static-top navbar-tongzhi">
<div class="container">
<!-- 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="#">主页</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="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Python</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Linux</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left">
<div class="input-group">
<input type="text" class="form-control" placeholder="搜索">
<span class="input-group-btn">
<button class="btn btn-default">
<i class="glyphicon glyphicon-search"></i>
</button>
</span>
</div> </form>
<a href="#" class="btn btn-primary navbar-btn navbar-right">
<i class="glyphicon glyphicon-shopping-cart"></i>
<span class="badge">42</span>
</a>
<ul class="nav navbar-nav navbar-right">
<li><a href="JavaScript:void(0)" data-toggle="modal" data-target="#myModal">登录</a></li>
<li><a>注册</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav> <!-- <div class="jumbotron jumbotron-tongzhi">
<div class="container">
<h1>Hello, 同志!</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe, ducimus provident laborum. Ullam maiores, illum blanditiis odit ratione natus deleniti dolorem veniam, nobis voluptas pariatur aut iste quam soluta recusandae?</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">更多同志</a></p>
</div>
</div> --> <div id="carousel-example-generic" class="carousel slide carousel-tongzhi">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol> <!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="data:images/play01.jpg" alt="...">
<div class="carousel-caption">
<h3>最好的同志手机</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloribus nostrum impedit deserunt illo reprehenderit aspernatur atque mollitia voluptatibus iure nobis commodi, dolorem molestias nisi optio tenetur tempora facere consequatur ratione.
</p>
</div>
</div>
<div class="item">
<img src="data:images/play02.jpg" alt="...">
<div class="carousel-caption"> </div>
</div> <div class="item">
<img src="data:images/play03.jpg" alt="...">
<div class="carousel-caption"> </div>
</div> <div class="item">
<img src="data:images/play04.jpg" alt="...">
<div class="carousel-caption"> </div>
</div> </div> <!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div> <div class="container">
<ol class="breadcrumb">
<li><a href="#">首页</a></li>
<li><a href="#">同志商城</a></li>
<li class="active">商品列表</li>
</ol>
</div> <div class="product-wrapper">
<div class="container">
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div> <div class="col-xs-6 col-sm-4 col-md-3">
<div class="thumbnail">
<img src="data:images/product01.jpg" alt="">
<div class="caption">
<h3>同志手机</h3>
<p>1800万像素,高清无码,双拍双摄</p>
<p>
<span>1800元</span>
</p>
<p>
<a href="#" class="btn btn-primary" role="button">立即购买</a>
<a href="#" class="btn btn-default" role="button">加入购物车</a>
</p>
</div>
</div>
</div>
</div> <nav aria-label="Page navigation">
<ul class="pagination">
<li>
<a href="#" aria-label="Previous">
<span aria-hidden="true">上一页</span>
</a>
</li>
<li><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="#" aria-label="Next">
<span aria-hidden="true">下一页</span>
</a>
</li>
</ul>
</nav>
</div>
</div> <div class="footer-tongzhi">
<div class="container">
<div class="row footer-links">
<div class="col-md-12">
<a href="#">GitHub</a>
<a href="#">GitHub</a>
<a href="#">同志 交友</a>
<a href="#">GitHub</a>
<a href="#">GitHub</a>
</div>
</div> <div class="row">
<div class="col-md-12">
<p>Designed and built with all the love in the world by @mdo and @fat. Maintained by the core team with the help of our contributors.</p>
<p>本项目源码受 MIT开源协议保护,文档受 CC BY 3.0 开源协议保护。</p>
</div>
</div>
</div>
</div> <!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">登录同志交友平台</h4>
</div>
<div class="modal-body">
<form action="#" class="">
<div class="form-group">
<label for="userInput">用户名:</label>
<input type="text" class="form-control" name="username" id="userInput">
</div> <div class="form-group">
<label for="">密码:</label>
<input type="password" name="pwd" id="pwdInput" class="form-control">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary">登录</button>
</div>
</div>
</div>
</div> <!--导入jquery-->
<script src="dist/js/jquery-3.3.1.js"></script>
<script src="dist/js/bootstrap.js"></script>
<script>
$(function(){
$('#carousel-example-generic').carousel({
interval: 1000
})
})
</script>
</body>
</html>
加入主题页面(不明显)