时间:2021-08-25 08:01:50 | 栏目:JavaScript代码 | 点击:次
本文实例为大家分享了Bootstrap缩略图与警告框的具体代码,供大家参考,具体内容如下
<html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap</title> <link rel="stylesheet" href="css/bootstrap.css" rel="external nofollow" /> </head> <body> <div class="container"> <div class="row"> <div class="col-lg-3"><!--thumbnail为缩略图,外围加了边框并变为圆角--> <a href="https://www.jb51.net" class="thumbnail"> <img src="../logo.jpg"/> </a> </div> <div class="col-lg-3"> <a href="https://www.jb51.net" class="thumbnail"> <img src="../logo.jpg"/> </a> </div> <div class="col-lg-3"> <a href="https://www.jb51.net" class="thumbnail"> <img src="../logo.jpg"/> </a> </div> <div class="col-lg-3"> <a href="https://www.jb51.net" class="thumbnail"> <img src="../logo.jpg"/> </a> </div> </div> <div class="row"> <div class="col-lg-4"> <div class="thumbnail"><!--给父级加上thumbnail--> <a href="https://www.jb51.net"> <img src="../logo.jpg"/> </a> <div class="caption"><!--可以增加图片与文字之间的距离--> <h3>水果</h3> <p>苹果梨橘子葡萄柚子香蕉苹果梨橘子葡萄柚子香蕉</p> </div> </div> </div> </div> </div> <div class="container"> <div class="row"> <p class="alert alert-danger">这里是一个警告框!!!<button class="close" data-dismiss="alert">×</button></p><!--data-dismiss="alert"使其与js进行交互--> </div> </div> <script src="js/jquery-2.1.0.js"></script> <script src="js/bootstrap.js"></script> </body> </html>
效果图: