BootStrap的基本使用
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>
加入主题页面(不明显)
BootStrap的基本使用的更多相关文章
- 旺财速啃H5框架之Bootstrap(五)
在上一篇<<旺财速啃H5框架之Bootstrap(四)>>做了基本的框架,<<旺财速啃H5框架之Bootstrap(二)>>篇里也大体认识了bootst ...
- 旺财速啃H5框架之Bootstrap(四)
上一篇<<旺财速啃H5框架之Bootstrap(三)>>已经把导航做了,接下来搭建内容框架.... 对于不规整的网页,要做成自适应就有点玩大了.... 例如下面这种版式的页面. ...
- bootstrap + requireJS+ director+ knockout + web API = 一个时髦的单页程序
也许单页程序(Single Page Application)并不是什么时髦的玩意,像Gmail在很早之前就已经在使用这种模式.通常的说法是它通过避免页面刷新大大提高了网站的响应性,像操作桌面应用程序 ...
- 参考bootstrap中的popover.js的css画消息弹框
前段时间小颖的大学同学给小颖发了一张截图,图片类似下面这张图: 小颖当时大概的给她说了下,其实小颖也不知道上面那个三角形怎么画嘻嘻,给她说了DOM结构,具体的css让她自己百度,今天小颖自己参考boo ...
- Bootstrap 模态框(Modal)插件
页面效果: html+js: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
- 利用bootstrap的carousel.js实现轮播图动画
前期准备: 1.jquery.js. 2.bootstrap的carousel.js. 3.bootstrap.css. 如果大家不知道在哪下载,可以联系小颖,小颖把这些js和css可以发送给你. 一 ...
- 旺财速啃H5框架之Bootstrap(三)
好多天没有写了,继续走起 在上一篇<<旺财速啃H5框架之Bootstrap(二)>>中已经把CSS引入到页面中,接下来开始写页面. 首先有些问题要先处理了,问什么你要学boot ...
- 旺财速啃H5框架之Bootstrap(二)
突然感觉不知道写啥子,脑子里面没水了,可能是因为今晚要出去浪,哈哈~~~提前提醒大家平安夜要回家哦,圣诞节生00000000000这么多蛋....继续 上一篇的已经把bootstrap了解个大概了,接 ...
- 旺财速啃H5框架之Bootstrap(一)
接下来的时间里,我将和大家一起对当前非常流行的前端框架Bootstrap进行速度的学习,以案例的形式.对刚开始想学习Bootstrap的同学而找不着边的就很有帮助了.如果你想详细的学习Bootstra ...
- [BootStrap] 富编辑器,基于wysihtml5
在我的周围,已经有很多人在使用BootStrap,但对于任何一个带留言.评论.提问.文章编辑功的网站,编辑器永远是重中之重,显然,早期的编辑器完全没考虑过BootStrap的出现,或皮肤跟网站不匹配, ...
随机推荐
- [YNOI 2016] 掉进兔子洞
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=4939 [算法] 不难发现 , ansi = (r1 - l1 + 1) + (r2 ...
- Python使用multiprocessing实现一个最简单的分布式作业调度系统
Python使用multiprocessing实现一个最简单的分布式作业调度系统介绍Python的multiprocessing模块不但支持多进程,其中managers子模块还支持把多进程分布到多台机 ...
- C++之运算符重载(前置++和后置++)
今天在阅读<google c++ 编程风格>的文档的时候,5.10. 前置自增和自减:有一句话引起了我的注意: 对于迭代器和其他模板对象使用前缀形式 (++i) 的自增, 自减运算符.,理 ...
- poj 2420 A Star not a Tree? —— 模拟退火
题目:http://poj.org/problem?id=2420 给出 n 个点的坐标,求费马点: 上模拟退火. 代码如下: #include<iostream> #include< ...
- leetcode 395 至少有K个重复字符的最长子串
找到给定字符串(由小写字符组成)中的最长子串 T , 要求 T 中的每一字符出现次数都不少于 k .输出 T 的长度. 示例 1: 输入: s = "aaabb", k = 3 输 ...
- TQ210——S5PV210 uboot顶层mkconfig分析
转自:http://blog.csdn.net/wqx521/article/details/52491300 ############################################ ...
- 使用tableview的表头button 实现多 cell 的选择
首先声明本篇博文是作者原创,在QQ群里看到一枚猿友求助,问题描述:使用UItableView 实现在表头里点击不同的按钮,去刷新当前的界面(界面是大的 cell),自己就实现了一下. 实验原材料:故事 ...
- web面试常见问题
1事件继承 function ClassA(sColor) { this.color = sColor; this.sayColor = function () { al ...
- 2.7 HBase架构深入剖析
一. 1.client 整个HBase集群的访问入口: 使用HBase RPC机制与HMaster和HRegionServer进行通信: 与HMaster进行通信进行管理类操作: 与HRegionSe ...
- 关于weblogic 10.3.6.0 的漏洞复现(2)
今天小R又学会了一个工具的使用,而且这个工具很强大很强大. 待会介绍. 一.需要的试验环境: 一台宿主机,虚拟机(kali+window2008或其他版本的windows) 1.宿主机需要的工具:B ...