css - Bootstrap 3 缩略图间距

标签 css twitter-bootstrap-3

我试图在 700 及以上的屏幕上显示两行 100x100 像素的缩略图,理想情况下两侧和底部的间距为 30 像素。缩略图位于将宽度限制为 700px 的 div 中,然后 fancybox 将它们打开得更大。我希望缩略图保留相同的填充,只调整到各种屏幕尺寸,但改变行数。下面是我正在使用的,它已经接近了,但我希望有更好的方法来微调它。

<div class="inner cover">
    <div class="row">
        <div class="col-md-3 col-sm-3 col-xs-4">
            <a data-fancybox-title="<p><em>this tittle/em>, smapletext.</p><p>  This is a whole bunch of text to use as a description</p>" class="fancybox" href="./placehold.it/700x00"><img src="./placehold.it/100x100" class="thumbnail img-responsive"></a>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-4">
            <a data-fancybox-title="<p><em>this tittle/em>, smapletext.</p><p>  This is a whole bunch of text to use as a description</p>" class="fancybox" href="./placehold.it/700x00"><img src="./placehold.it/100x100" class="thumbnail img-responsive"></a>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-4">
            <a data-fancybox-title="<p><em>this tittle/em>, smapletext.</p><p>  This is a whole bunch of text to use as a description</p>" class="fancybox" href="./placehold.it/700x00"><img src="./placehold.it/100x100" class="thumbnail img-responsive"></a>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-4">
            <a data-fancybox-title="<p><em>this tittle/em>, smapletext.</p><p>  This is a whole bunch of text to use as a description</p>" class="fancybox" href="./placehold.it/700x00"><img src="./placehold.it/100x100" class="thumbnail img-responsive"></a>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-4">
            <a data-fancybox-title="<p><em>this tittle/em>, smapletext.</p><p>  This is a whole bunch of text to use as a description</p>" class="fancybox" href="./placehold.it/700x00"><img src="./placehold.it/100x100" class="thumbnail img-responsive"></a>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-4">
            <a data-fancybox-title="<p><em>this tittle/em>, smapletext.</p><p>  This is a whole bunch of text to use as a description</p>" class="fancybox" href="./placehold.it/700x00"><img src="./placehold.it/100x100" class="thumbnail img-responsive"></a>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-4">
            <a data-fancybox-title="<p><em>this tittle/em>, smapletext.</p><p>  This is a whole bunch of text to use as a description</p>" class="fancybox" href="./placehold.it/700x00"><img src="./placehold.it/100x100" class="thumbnail img-responsive"></a>
        </div>
    </div> 
</div>

最佳答案

如果我了解您想要实现的目标,float:left 就是您的伙伴...

CSS:

img{
  float:left; 
  margin:15px
}

HTML:

<div class="inner cover">
  <div class="container">
    <a class="fancybox" href="http://placehold.it/700x700">
      <img src="http://placehold.it/100x100" class="thumbnail img-responsive">
    </a>
    <a class="fancybox" href="http://placehold.it/700x700">
      <img src="http://placehold.it/100x100" class="thumbnail img-responsive">
    </a>
    <a class="fancybox" href="http://placehold.it/700x700">
      <img src="http://placehold.it/100x100" class="thumbnail img-responsive">
    </a>
    ...      
  </div>
</div>

示例:http://www.bootply.com/y6Q6lnJxdJ

您可能还想定义一个 max-width,或者在其中放置一个 col-sm-8 col-sm-2-offset 将它们放入您的特定大小的盒子,或强制你的两行,但希望它能帮助你开始。

关于css - Bootstrap 3 缩略图间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21692759/

相关文章:

css - 大标签作为 Vaadin 8 网络应用程序中的标题

css - VS2015-Cordova-Ionic-Angular-ngMap : map height defaults to 300px

html - CSS-Centering-多行

html - bootstrap form-inline 和 form-group 中 <label> 标签周围的空白

javascript - 如何从左侧而不是从顶部滑动导航栏?

html - 如果谷歌字体不可用,如何指定网络安全用户默认字体

css - Bootstrap 3.3.7 中的多输入支持

html - 如何将数值绑定(bind)到 CSS 以创建时间轴?

css - 我可以按特定顺序定位 css 选择器吗?

javascript - 如何将 Bootstrap 下拉列表添加到列表元素内的按钮