Vertical Gaps Appearing - jQuery Masonry - (seamless photo grid)

不羁的心 提交于 2019-12-02 13:16:52

问题


This question has already been asked in a different situation.

I am trying to achieve a seamless photo grid with jQuery Masonry.

Check out my fiddle:

http://jsfiddle.net/drw158/sAkjv/

There is a vertical gap. Why?


回答1:


Display your images as block-level elements:

.ct-coll-item img {
  display: block;
}

See if this works: http://jsfiddle.net/drw158/sAkjv/1/

As for the why, I have no idea. My guess would be because the images are inline elements, but that isn't a direct explanation.




回答2:


The problem is your doctype. Change it to XHTML 1.0 Transitional then everything is fine




回答3:


You should make the <img/> a float.



来源:https://stackoverflow.com/questions/9579017/vertical-gaps-appearing-jquery-masonry-seamless-photo-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!