<html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1"> <title>Bootstrap</title> <link href="https://www.jb51.net/css/bootstrap.css" /> </head> <body> <div> <div> <div><!--thumbnail为缩略图,外围加了边框并变为圆角--> <a href="https://www.jb51.net"> <img src="https://www.jb51.net/logo.jpg"/> </a> </div> <div> <a href="https://www.jb51.net"> <img src="https://www.jb51.net/logo.jpg"/> </a> </div> <div> <a href="https://www.jb51.net"> <img src="https://www.jb51.net/logo.jpg"/> </a> </div> <div> <a href="https://www.jb51.net"> <img src="https://www.jb51.net/logo.jpg"/> </a> </div> </div> <div> <div> <div><!--给父级加上thumbnail--> <a href="https://www.jb51.net"> <img src="https://www.jb51.net/logo.jpg"/> </a> <div><!--可以增加图片与文字之间的距离--> <h3>水果</h3> <p>苹果梨橘子葡萄柚子香蕉苹果梨橘子葡萄柚子香蕉</p> </div> </div> </div> </div> </div> <div> <div> <p>这里是一个警告框!!!<button data-dismiss="alert">×</button></p><!--data-dismiss="alert"使其与js进行交互--> </div> </div> <script src="https://www.jb51.net/js/jquery-2.1.0.js"></script> <script src="https://www.jb51.net/js/bootstrap.js"></script> </body> </html>
效果图: