我有几个百分比大小的 div,屏幕上max-width:1030px
的 div 为 50%。但是第五个 div 在继续之前留下了一个空白区域。
我不知道为什么。在这里查看演示(屏幕尺寸必须小于 1030 像素才能看到)
HTML
<div class="video-grid">
<div class="vimeo">
<a class="fancybox-media" href="http://player.vimeo.com/video/65191942?title=0&byline=0&portrait=0&color=dd4c23">
<img alt="" src="http://b.vimeocdn.com/ts/435/991/435991395_640.jpg" />
</a>
</div>
<div class="vimeo">
<a class="fancybox-media" href="http://player.vimeo.com/video/65191942?title=0&byline=0&portrait=0&color=dd4c23">
<img alt="" src="http://b.vimeocdn.com/ts/436/269/436269192_640.jpg" />
</a>
</div>
<div class="vimeo">
<a class="fancybox-media" href="http://player.vimeo.com/video/65191942?title=0&byline=0&portrait=0&color=dd4c23">
<img alt="" src="http://b.vimeocdn.com/ts/436/115/436115827_640.jpg" />
</a>
</div>
<div class="vimeo">
<a class="fancybox-media" href="http://player.vimeo.com/video/65191942?title=0&byline=0&portrait=0&color=dd4c23">
<img alt="" src="http://b.vimeocdn.com/ts/435/991/435991608_640.jpg" />
</a>
</div>
<div class="vimeo">
<a class="fancybox-media" href="http://player.vimeo.com/video/65191942?title=0&byline=0&portrait=0&color=dd4c23">
<img alt="" src="http://b.vimeocdn.com/ts/435/991/435991608_640.jpg" />
</a>
</div>
<div class="vimeo">
<a class="fancybox-media" href="http://player.vimeo.com/video/65191942?title=0&byline=0&portrait=0&color=dd4c23">
<img alt="" src="http://new.stevenspiel.com/wp-content/themes/Photum/images/kiss.jpg" />
</a>
</div>
<div class="vimeo">
<a class="fancybox-media" href="http://player.vimeo.com/video/65191942?title=0&byline=0&portrait=0&color=dd4c23">
<img alt="" src="http://b.vimeocdn.com/ts/435/991/435991206_640.jpg" />
</a>
</div>
</div>
CSS
.video-grid {
width:100%;
}
.vimeo {
max-width:400px;
min-width:250px;
width:33%;
float:left;
}
.vimeo img {
width:90%;
padding:5%;
}
@media screen and (max-width:1030px) {
.vimeo {
width:50%;
min-width: 170px;
}
}