我正在尝试交替边距以使图像上下曲折。我发现这篇文章很接近,但将一个更改应用于所有 .brochureImg 类。我究竟做错了什么?
HTML
<div class="brochureBrand">
<ul>
<li class="brochureName hrDots"><a href="#">GP & J Baker</a>
<li class="brochureImg first"><a href="#"><img src="http://placehold.it/125x175"></a></li>
<li class="brochureImg"><a href="#"><img src="http://placehold.it/125x175"></a></li>
<li class="brochureImg"><a href="#"><img src="http://placehold.it/125x175"></a></li>
<li class="brochureImg"><a href="#"><img src="http://placehold.it/125x175"></a></li>
<li class="brochureImg"><a href="#"><img src="http://placehold.it/125x175"></a></li>
<li class="brochureImg"><a href="#"><img src="http://placehold.it/125x175"></a></li>
<li class="brochureImg"><a href="#"><img src="http://placehold.it/125x175"></a></li>
</li>
</ul>
</div>
CSS
.brochureImg {
display: inline-block;
margin: 0 auto;
margin-top: -90px;
padding: 0 16px 150px 0;
position: relative;
z-index: 100;
}
.brochureImg img {
box-shadow: 3px 3px 8px #666666;
}
.brochureImg a img:nth-child(odd) {
margin-top: -120px;
}
.brochureImg a img:nth-child(even) {
margin-top: -60px;
}
.brochureImg.first {
margin-left: 125px;
}