简体   繁体   English

Bootstrap IMG Gallery中图像周围的空白

[英]White Space Around Images in Bootstrap IMG Gallery

http://seattleasce.org/images/test_gallery/ymf_history.php http://seattleasce.org/images/test_gallery/ymf_history.php

I'm working on this site and have been trying to remove the extra white space between images. 我正在这个网站上工作,一直在尝试删除图像之间的多余空白。 I'm using bootstrap and the bootstrap image gallery libraries, and can't seem to figure out how to fix this. 我正在使用bootstrap和bootstrap图片库库,似乎无法弄清楚该如何解决。 Any help would be really appreciated! 任何帮助将非常感激!

the problem is a elements are inherently inline-block which has a natural padding of about 1 or 2px. 问题是a件本身是inline-block ,其具有约1或2像素的自然填充。 There are some hacks to remove the spacing but it's better practice to use float: left instead. 有一些技巧可以消除间距,但是最好使用float: left代替。 Just be sure to clear your floats or add overflow: hidden to their parent. 只需确保清除浮标或添加overflow: hidden对父母overflow: hidden即可。

EX: 例如:

 /*CSS*/ .SomeClassName{ display: block; float: left; } 
 <!--HTML--> <a href=" /images/test_gallery/IMG_0422.JPG " data-gallery="" class="SomeClassName"> <img width="100px" src=" /images/test_gallery/resize/IMG_0422.JPG "> </a> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM