Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 引导,IMG在列中有间隙_Twitter Bootstrap_Twitter Bootstrap 3 - Fatal编程技术网

Twitter bootstrap 引导,IMG在列中有间隙

Twitter bootstrap 引导,IMG在列中有间隙,twitter-bootstrap,twitter-bootstrap-3,Twitter Bootstrap,Twitter Bootstrap 3,好的,我有一个问题,我想有四个块图像,是200px乘以200px,排成一行 我希望所有四个图像都没有填充,以便它们都在左右两侧相互接触 <div class="container"> <div class="row top"> <div class="col-sm-3"> <img src="img/1.jpg" width="200" height="200"/>

好的,我有一个问题,我想有四个块图像,是200px乘以200px,排成一行

我希望所有四个图像都没有填充,以便它们都在左右两侧相互接触

  <div class="container">
      <div class="row top">
          <div class="col-sm-3">
              <img src="img/1.jpg" width="200" height="200"/>
          </div>
          <div class="col-sm-3">
              <img src="img/2.jpg"width="200" height="200"/>
          </div>
          <div class="col-sm-3">
              <img src="img/3.jpg" width="200" height="200"/>
          </div>
          <div class="col-sm-3">
              <img src="img/4.jpg" width="200" height="200"/>
          </div>
      </div>
  </div>

这导致两侧都有填充。但是,如果我删除图像并将类放在css属性为200px x x 200px的列上。他们做我想让它做的事

仅使用背景色查看每个框的工作示例。


我如何让图像像这四个类一样相互接触?

你要找的是这样的东西吗


但是刚刚添加了一个类
.col-sm-3{display:inline block;}
,它根据您的需要显示。如果他需要列,它需要删除为divs的col md-*类添加的填充,这可以通过
@media(min width:992px){.col fixed-200{width:200px;padding:0px;}完成
如果他没有,您的解决方案就是干净、合适的解决方案
<div class="container">
    <div class="row">
         <div class="col-xs-12">
            <img src="http://placehold.it/200x200"/>
            <img src="http://placehold.it/200x200"/>
            <img src="http://placehold.it/200x200"/>
            <img src="http://placehold.it/200x200"/>
        </div>
    </div>
</div>
img {
    display: block;
    float: left;
    border: 1px dashed #333;
}