出于某种原因,我在此页面的 H1 标记下方有大量空间。当 H1 被移除时,额外的空间被移除,但我无法隔离导致这种情况的代码。我用 !important 应用了 0 的边距,但这没有效果。
<div class="videoGallery large-12 columns">
<h1>Fitness Videos</h1>
<div class="videoPreviewBox">
<a class="video1" href="#">
<div class="videoPreview">
<img class="videoPreviewImg" src="img/promo/groupFitness.jpg">
<img class="playButtonHover" src="../img/playButtonHover.png">
<img class="playButton" src="../img/playButton.png">
</div>
</a>
</div>
这是CSS:
.videoGallery h1 {
color: white;
font-size: 24px;
margin: 0 !important;
padding: 0 !important;
line-height: 24px;
}
div.videoPreviewBox {
float: left;
display: inline-block;
width: 21%;
margin: 0% 2%;
}
@media only screen and (max-width: 594px) {
div.videoPreviewBox {
width: 46%;
}
}
@media only screen and (max-width: 300px) {
div.videoPreviewBox {
width: 96%;
}
}
div.videoPreview {
position: relative;
}
img.videoPreviewImg {
width: 100%;
z-index: 1;
}
img.playButtonHover, img.playButton {
position: absolute;
z-index: 5;
top: 50%;
left: 50%;
margin-top: -24px;
margin-left: -24px;
-webkit-transition: opacity .7s ease-in-out;
-moz-transition: opacity .7s ease-in-out;
-o-transition: opacity .7s ease-in-out;
transition: opacity .7s ease-in-out;
}
div.videoPreview:hover img.playButton {
opacity: 0;
}
div.videoPreviewBox p {
margin: 2% 0% 4% 0%;
color: white;
line-height: 18px;
}
起初我认为问题可能是由 jQuery 插件 equalHeights 引起的,它用于使包含预览图像和描述段落的所有框的高度相同,但如果是这种情况,那么开放空间也将是在两行之间重复。
任何指针都非常感谢!