JavaWeb11.2【BootStrap:CSS样式和JS插件】
3_Bootstrap_CSS全局样式_按钮图片
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>3_Bootstrap_CSS全局样式</title> 6 7 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 8 <meta name="viewport" content="width=device-width, initial-scale=1"> 9 <link href="css/bootstrap.min.css" rel="stylesheet"> 10 <script src="js/jquery-3.2.1.min.js"></script> 11 <script src="js/bootstrap.min.js"></script> 12 13 14 </head> 15 <body> 16 <a class="btn btn-default" href="#" >Link</a> 17 <button class="btn btn-default" type="submit">Button</button> 18 <input class="btn btn-default" type="button" value="Input"> 19 <input class="btn btn-default" type="submit" value="Submit"> 20 <br> 21 22 <!-- Provides extra visual weight and identifies the primary action in a set of buttons --> 23 <button type="button" class="btn btn-primary">(首选项)Primary</button> 24 <!-- Indicates a successful or positive action --> 25 <button type="button" class="btn btn-success">(成功)Success</button> 26 <!-- Contextual button for informational alert messages --> 27 <button type="button" class="btn btn-info">(一般信息)Info</button> 28 <!-- Indicates caution should be taken with this action --> 29 <button type="button" class="btn btn-warning">(警告)Warning</button> 30 <!-- Indicates a dangerous or potentially negative action --> 31 <button type="button" class="btn btn-danger">(危险)Danger</button> 32 <!-- Deemphasize a button by making it look like a link while maintaining button behavior --> 33 <button type="button" class="btn btn-link">(链接)Link</button> 34 <hr> 35 36 <img src="img/banner_1.jpg" class="img-responsive"/> 37 <img src="img/banner_1.jpg" class="img-responsive img-rounded" /> 38 <img src="img/banner_1.jpg" class="img-responsive img-circle"/> 39 <img src="img/banner_1.jpg" class="img-responsive img-thumbnail"/> 40 <hr> 41 </body> 42 </html>
4_Bootstrap_CSS全局样式_表格表单
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 7 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <link href="css/bootstrap.min.css" rel="stylesheet"> 9 <script src="js/jquery-3.2.1.min.js"></script> 10 <script src="js/bootstrap.min.js"></script> 11 </head> 12 <body> 13 <table class="table table-bordered table-hover"> 14 <tr> 15 <th>编号</th> 16 <th>姓名</th> 17 <th>年龄</th> 18 </tr> 19 <tr> 20 <td>001</td> 21 <td>张三</td> 22 <td>23</td> 23 </tr> 24 <tr> 25 <td>002</td> 26 <td>张三</td> 27 <td>23</td> 28 </tr> 29 <tr> 30 <td>003</td> 31 <td>张三</td> 32 <td>23</td> 33 </tr> 34 </table> 35 <hr> 36 37 <form class="form-horizontal"> 38 <div class="form-group"> 39 <label for="exampleInputEmail1" class="col-sm-2 control-label">Email address</label> 40 41 <div class="col-sm-10"> 42 <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email"> 43 </div> 44 </div> 45 <div class="form-group"> 46 <label for="inputPassword3" class="col-sm-2 control-label">Password</label> 47 <div class="col-sm-10"> 48 <input type="password" class="form-control" id="inputPassword3" placeholder="Password"> 49 </div> 50 </div> 51 <div class="form-group"> 52 <div class="col-sm-offset-2 col-sm-10"> 53 <div class="checkbox"> 54 <label> 55 <input type="checkbox"> Remember me 56 </label> 57 </div> 58 </div> 59 </div> 60 <div class="form-group"> 61 <div class="col-sm-offset-2 col-sm-10"> 62 <button type="submit" class="btn btn-default">Sign in</button> 63 </div> 64 </div> 65 </form> 66 </body> 67 </html>
5_Bootstrap_组件_导航条
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 7 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <link href="css/bootstrap.min.css" rel="stylesheet"> 9 <script src="js/jquery-3.2.1.min.js"></script> 10 <script src="js/bootstrap.min.js"></script> 11 </head> 12 <body> 13 <nav class="navbar navbar-inverse"> 14 <div class="container-fluid"> 15 <!-- Brand and toggle get grouped for better mobile display --> 16 <div class="navbar-header"> 17 <!-- 定义汉堡按钮 --> 18 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> 19 <span class="sr-only">Toggle navigation</span> 20 <span class="icon-bar"></span> 21 <span class="icon-bar"></span> 22 <span class="icon-bar"></span> 23 </button> 24 <a class="navbar-brand" href="#">首页</a> 25 </div> 26 27 <!-- Collect the nav links, forms, and other content for toggling --> 28 <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 29 <ul class="nav navbar-nav"> 30 <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li> 31 <li><a href="#">Link</a></li> 32 <li class="dropdown"> 33 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> 34 <ul class="dropdown-menu"> 35 <li><a href="#">Action</a></li> 36 <li><a href="#">Another action</a></li> 37 <li><a href="#">Something else here</a></li> 38 <li role="separator" class="divider"></li> 39 <li><a href="#">Separated link</a></li> 40 <li role="separator" class="divider"></li> 41 <li><a href="#">One more separated link</a></li> 42 </ul> 43 </li> 44 </ul> 45 <form class="navbar-form navbar-left"> 46 <div class="form-group"> 47 <input type="text" class="form-control" placeholder="Search"> 48 </div> 49 <button type="submit" class="btn btn-default">Submit</button> 50 </form> 51 <ul class="nav navbar-nav navbar-right"> 52 <li><a href="#">Link</a></li> 53 <li class="dropdown"> 54 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> 55 <ul class="dropdown-menu"> 56 <li><a href="#">Action</a></li> 57 <li><a href="#">Another action</a></li> 58 <li><a href="#">Something else here</a></li> 59 <li role="separator" class="divider"></li> 60 <li><a href="#">Separated link</a></li> 61 </ul> 62 </li> 63 </ul> 64 </div><!-- /.navbar-collapse --> 65 </div><!-- /.container-fluid --> 66 </nav> 67 </body> 68 </html>
6_Bootstrap_组件_分页条
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 7 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <link href="css/bootstrap.min.css" rel="stylesheet"> 9 <script src="js/jquery-3.2.1.min.js"></script> 10 <script src="js/bootstrap.min.js"></script> 11 </head> 12 <body> 13 <nav aria-label="Page navigation"> 14 <ul class="pagination"> 15 <li class="disabled"> 16 <a href="#" aria-label="Previous"> 17 <span aria-hidden="true">«</span> 18 </a> 19 </li> 20 <li><a href="#">1</a></li> 21 <li class="active"><a href="#">2</a></li> 22 <li><a href="#">3</a></li> 23 <li><a href="#">4</a></li> 24 <li><a href="#">5</a></li> 25 <li> 26 <a href="#" aria-label="Next"> 27 <span aria-hidden="true">»</span> 28 </a> 29 </li> 30 </ul> 31 </nav> 32 </body> 33 </html>
7_Bootstrap_插件_轮播图
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 7 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <link href="css/bootstrap.min.css" rel="stylesheet"> 9 <script src="js/jquery-3.2.1.min.js"></script> 10 <script src="js/bootstrap.min.js"></script> 11 </head> 12 <body> 13 <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> 14 <!-- Indicators --> 15 <ol class="carousel-indicators"> 16 <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> 17 <li data-target="#carousel-example-generic" data-slide-to="1"></li> 18 <li data-target="#carousel-example-generic" data-slide-to="2"></li> 19 </ol> 20 21 <!-- Wrapper for slides --> 22 <div class="carousel-inner" role="listbox"> 23 <div class="item active"> 24 <img src="img/banner_1.jpg" alt="..."> 25 </div> 26 <div class="item"> 27 <img src="img/banner_2.jpg" alt="..."> 28 </div> 29 <div class="item"> 30 <img src="img/banner_3.jpg" alt="..."> 31 </div> 32 33 </div> 34 35 <!-- Controls --> 36 <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> 37 <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> 38 <span class="sr-only">Previous</span> 39 </a> 40 <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> 41 <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> 42 <span class="sr-only">Next</span> 43 </a> 44 </div> 45 </body> 46 </html>