Bootstrap缩略图的创建方法

 更新时间:2017年03月22日 08:54:11   作者:boonyaxnn  
这篇文章主要介绍了Bootstrap缩略图的创建方法,教大家如何实现Bootstrap缩略图,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

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>

 效果图

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

相关文章

  • js获取html的span标签的值方法(超简单)

    js获取html的span标签的值方法(超简单)

    下面小编就为大家带来一篇js获取html的span标签的值方法(超简单)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-07-07
  • js数组与字符串常用方法总结

    js数组与字符串常用方法总结

    本文主要总结了js数组与字符串的常用方法。具有一定的参考价值,下面跟着小编一起来看下吧
    2017-01-01
  • JavaScript 如何计算文本的行数的实现

    JavaScript 如何计算文本的行数的实现

    这篇文章主要介绍了JavaScript 如何计算文本的行数的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-09-09
  • 基于 Immutable.js 实现撤销重做功能的实例代码

    基于 Immutable.js 实现撤销重做功能的实例代码

    这篇文章主要介绍了基于 Immutable.js 实现撤销重做功能及一些需要注意的地方,需要的朋友可以参考下
    2018-03-03
  • JavaScript中的Error错误对象与自定义错误类型详解

    JavaScript中的Error错误对象与自定义错误类型详解

    Error是JavaScript中最原始的错误对象,作为各种异常的基础对象,还有多个衍生的具体的错误类型,这些错误对象类型在nodejs中也可应用,这篇文章主要介绍了JavaScript中的Error错误对象与自定义错误类型,需要的朋友可以参考下
    2022-12-12
  • ECMAScript6变量的解构赋值实例详解

    ECMAScript6变量的解构赋值实例详解

    ES6允许按照一定模式,从数组和对象中提取值,对变量进行赋值,这被称为解构(Destructuring),下文中给大家提供了嵌套数组的解构例子,大家一起看看吧
    2017-09-09
  • JavaScript获取flash对象与网上的有所不同

    JavaScript获取flash对象与网上的有所不同

    关于js获取flash对象,网上有非常多的例子,但不是我想要的,经测试整理,因此本文诞生了
    2014-04-04
  • JS实现炫酷轮播图

    JS实现炫酷轮播图

    这篇文章主要为大家详细介绍了JS实现炫酷轮播图,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2020-11-11
  • javascript变量声明实例分析

    javascript变量声明实例分析

    这篇文章主要介绍了javascript变量声明,实例分析了javascript变量声明的相关使用技巧,需要的朋友可以参考下
    2015-04-04
  • javascript 将共享属性迁移到原型中去的实现方法

    javascript 将共享属性迁移到原型中去的实现方法

    下面小编就为大家带来一篇javascript 将共享属性迁移到原型中去的实现方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-08-08

最新评论