Bootstrap 是最受欢迎的 HTML、CSS 和 JS 框架,用于开发响应式布局、移动设备优先的 WEB 项目。
官网下载入门?
下载 Bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>入门</title>
<!--移动设备优先-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--引入bs的核心css文件-->
<!--<link rel="stylesheet" href="bootstrap-3.4.1-dist/css/bootstrap.css">-->
<!--jq-->
<script src="js/jquery-3.6.0.min.js"></script>
<!--引入bs的核心js文件-->
<!--<script src="bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>-->
<!--BootstrapCDN-->
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<style>
.row div{
background: plum;
border: 1px solid purple;
}
img{
width: 100%;
}
</style>
</head>
<body>
<div class="container">
<!--导航-->
<ul class="nav nav-tabs">
<li role="presentation" class="active"><a href="#">导航</a></li>
<li role="presentation"><a href="#">Profile</a></li>
<li role="presentation"><a href="#">Messages</a></li>
</ul>
<!--轮播图-->
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- 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>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="images/pexels-photo-6157297.jpeg" alt="...">
<div class="carousel-caption">
小汽车1
</div>
</div>
<div class="item">
<img src="images/pexels-photo-6161473.jpeg" alt="...">
<div class="carousel-caption">
小汽车1
</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="row">
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
<div class="col-md-1">晴天</div>
</div>
<div class="row">
<div class="col-md-8">.col-md-8</div>
<div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
<div class="col-md-4"><img src="images/xiaoxin.png"></div>
<div class="col-md-4"><img src="images/xiaoxin.png"></div>
<div class="col-md-4"><img src="images/xiaoxin.png"></div>
</div>
<div class="row">
<div class="col-md-6">.col-md-6</div>
<div class="col-md-6">.col-md-6</div>
</div>
<div class="row">
<div class="col-xs-10 col-sm-4 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div>
<div class="col-xs-2 col-sm-8 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<!--标题-->
<h1 class="text-center">h1. Bootstrap heading <small>Secondary text</small></h1>
<h2 class="text-right">h2. Bootstrap heading <small>Secondary text</small></h2>
<h3>h3. Bootstrap heading <small>Secondary text</small></h3>
<h4>h4. Bootstrap heading <small>Secondary text</small></h4>
<h5>h5. Bootstrap heading <small>Secondary text</small></h5>
<h6>h6. Bootstrap heading <small>Secondary text</small></h6>
<!--按钮-->
<a class="btn btn-default" href="#" role="button">Link</a>
<button class="btn btn-default" type="submit">Button</button>
<input class="btn btn-default" type="button" value="Input">
<input class="btn btn-danger" type="submit" value="危险!!!">
<!--表单-->
<form>
<div class="form-group">
<label for="exampleInputEmail1">用户名:</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">密码:</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="form-group">
<label for="exampleInputFile">File input</label>
<input type="file" id="exampleInputFile">
<p class="help-block">Example block-level help text here.</p>
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Check me out
</label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</body>
</html>
?
|