Bootstrap缩略图的创建方法


Posted in Javascript onMarch 22, 2017

Bootstrap 创建缩略图的步骤如下:

1、在图像周围添加带有 class .thumbnail 的 <a> 标签.
2、这会添加四个像素的内边距(padding)和一个灰色的边框。

有了一个基本的缩略图,我们可以向缩略图添加各种 HTML 内容,比如标题、段落或按钮。具体步骤如下:
1、把带有  class .thumbnail 的 <a> 标签改为 <div>。
2、在该 <div> 内,您可以添加任何您想要添加的东西。由于这是一个 <div>,我们可以使用默认的基于 span 的命名规则来调整大小。

html代码

<!DOCTYPE html> 
<html> 
<head> 
 <title>Bootstrap 页面标题(Page Header)</title> 
 <meta charset="utf-8"> 
 <link rel="stylesheet" href="css/bootstrap.min.css" rel="external nofollow" > 
 <style> 
  h2{ 
  color: #080808; 
  font-weight:900;  
  text-shadow:1px 1px 0px #AD55C9; 
  } 
  p{ 
  color: #6A031A; 
  size: 24px; 
  } 
 </style> 
</head> 
 
<body> 
<div class="row"> 
 <div class="col-sm-6 col-md-3"> 
  <div class="thumbnail"><img src="img/2.jpg"></div> 
  <div class="caption"> 
   <h2>漂亮的图片</h2> 
   <p>漂亮的图片.漂亮的图片.</p> 
   <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">点你 </a> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就点你 </a> 
   </p> 
  </div> 
 </div> 
  
 <div class="col-sm-6 col-md-3"> 
  <div class="thumbnail"><img src="img/2.jpg"></div> 
  <div class="caption"> 
   <h2>漂亮的图片</h2> 
   <p>漂亮的图片.漂亮的图片.</p> 
   <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">点你 </a> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就点你 </a> 
   </p> 
  </div> 
 </div> 
 <div class="col-sm-6 col-md-3"> 
  <div class="thumbnail"><img src="img/2.jpg"></div> 
  <div class="caption"> 
   <h2>漂亮的图片</h2> 
   <p>漂亮的图片.漂亮的图片.</p> 
   <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">点你 </a> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就点你 </a> 
   </p> 
  </div> 
 </div> 
 <div class="col-sm-6 col-md-3"> 
  <div class="thumbnail"><img src="img/2.jpg"></div> 
  <div class="caption"> 
   <h2>漂亮的图片</h2> 
   <p>漂亮的图片.漂亮的图片.</p> 
   <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">点你 </a> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就点你 </a> 
   </p> 
  </div> 
 </div> 
 <div class="col-sm-6 col-md-3"> 
  <div class="thumbnail"><img src="img/2.jpg"></div> 
  <div class="caption"> 
   <h2>漂亮的图片</h2> 
   <p>漂亮的图片.漂亮的图片.</p> 
   <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">点你 </a> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就点你 </a> 
   </p> 
  </div> 
 </div><div class="col-sm-6 col-md-3"> 
  <div class="thumbnail"><img src="img/2.jpg"></div> 
  <div class="caption"> 
   <h2>漂亮的图片</h2> 
   <p>漂亮的图片.漂亮的图片.</p> 
   <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">点你 </a> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就点你 </a> 
   </p> 
  </div> 
 </div><div class="col-sm-6 col-md-3"> 
  <div class="thumbnail"><img src="img/2.jpg"></div> 
  <div class="caption"> 
   <h2>漂亮的图片</h2> 
   <p>漂亮的图片.漂亮的图片.</p> 
   <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">点你 </a> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就点你 </a> 
   </p> 
  </div> 
 </div><div class="col-sm-6 col-md-3"> 
  <div class="thumbnail"><img src="img/2.jpg"></div> 
  <div class="caption"> 
   <h2>漂亮的图片</h2> 
   <p>漂亮的图片.漂亮的图片.</p> 
   <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">点你 </a> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就点你 </a> 
   </p> 
  </div> 
 </div> 
</div> 
<script src="js/jquery.min.js"></script> 
<script src="js/bootstrap.min.js"></script> 
 </body> 
</html>

 效果图

Bootstrap缩略图的创建方法

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持三水点靠木。

Javascript 相关文章推荐
js关闭模态窗口刷新父页面或跳转页面
Dec 13 Javascript
jQuery实现仿微软首页感应鼠标变化滑动窗口效果
Oct 08 Javascript
jquery实现仿新浪微博带动画效果弹出层代码(可关闭、可拖动)
Oct 12 Javascript
JavaScript判断页面加载完之后再执行预定函数的技巧
May 17 Javascript
JavaScript中const、var和let区别浅析
Oct 11 Javascript
详解js中Number()、parseInt()和parseFloat()的区别
Dec 20 Javascript
jQuery中ztree 点击文本框弹出下拉框的实例代码
Feb 05 Javascript
vue子父组件通信的实现代码
Jul 09 Javascript
vue项目中实现的微信分享功能示例
Jan 21 Javascript
jquery 验证用户名是否重复代码实例
May 14 jQuery
Vue记住滚动条和实现下拉加载的完美方法
Jul 31 Javascript
如何利用javascript接收json信息并进行处理
Aug 06 Javascript
JS+DIV实现的卷帘效果示例
Mar 22 #Javascript
Bootstrap页面标题Page Header的实现方法
Mar 22 #Javascript
javascript实现滑动解锁功能
Mar 22 #Javascript
Bootstrap警告(Alerts)的实现方法
Mar 22 #Javascript
bootstrap IE8 兼容性处理
Mar 22 #Javascript
详解angular中通过$location获取路径(参数)的写法
Mar 21 #Javascript
jQuery+ThinkPHP+Ajax实现即时消息提醒功能实例代码
Mar 21 #jQuery
You might like
php flv视频时间获取函数
2010/06/29 PHP
php实现获取文章内容第一张图片的方法
2014/11/04 PHP
为你总结一些php系统类函数
2015/10/21 PHP
PHP读书笔记_运算符详解
2016/07/01 PHP
php curl上传、下载、https登陆实现代码
2017/07/23 PHP
php实现的中秋博饼游戏之掷骰子并输出结果功能详解
2017/11/06 PHP
在PHP中输出JS语句以及乱码问题的解决方案
2019/02/13 PHP
PHP与Web页面交互操作实例分析
2020/06/02 PHP
php 利用socket发送GET,POST请求的实例代码
2020/07/04 PHP
JS在TextArea光标位置插入文字并实现移动光标到文字末尾
2013/06/21 Javascript
node.js中的console.dir方法使用说明
2014/12/10 Javascript
JavaScript中的全局对象介绍
2015/01/01 Javascript
JavaScript自定义等待wait函数实例分析
2015/03/23 Javascript
快速掌握Node.js中setTimeout和setInterval的使用方法
2016/03/21 Javascript
Angular的事件和表单详解
2016/12/26 Javascript
JavaScrpt判断一个数是否是质数的实例代码
2017/06/11 Javascript
ES6使用Set数据结构实现数组的交集、并集、差集功能示例
2017/10/31 Javascript
详解vue移动端项目的适配(以mint-ui为例)
2018/08/17 Javascript
微信小程序实现文字跑马灯
2020/05/26 Javascript
vueScroll实现移动端下拉刷新、上拉加载
2019/03/22 Javascript
NodeJS读取分析Nginx错误日志的方法
2019/05/14 NodeJs
如何在postman中添加cookie信息步骤解析
2020/06/30 Javascript
vue中解决拖拽改变存在iframe的div大小时卡顿问题
2020/07/22 Javascript
实用的 vue tags 创建缓存导航的过程实现
2020/12/03 Vue.js
巧用Python装饰器 免去调用父类构造函数的麻烦
2012/05/18 Python
python使用__slots__让你的代码更加节省内存
2018/09/05 Python
解决python3 requests headers参数不能有中文的问题
2019/08/21 Python
Python基于内置库pytesseract实现图片验证码识别功能
2020/02/24 Python
pyqt5数据库使用详细教程(打包解决方案)
2020/03/25 Python
Python 给下载文件显示进度条和下载时间的实现
2020/04/02 Python
经贸专业毕业生求职信范文
2014/05/01 职场文书
做人民满意的公务员活动方案
2014/08/25 职场文书
法定授权委托证明书
2014/09/27 职场文书
先进工作者事迹材料
2014/12/23 职场文书
博物馆观后感
2015/06/05 职场文书
Mac M1安装mnmp (Mac+Nginx+MySQL+PHP) 开发环境
2021/03/29 PHP