为什么这些卡片在页面上级联?

时间:2019-04-15 16:30:20

标签: wordpress

当您向下滚动页面时,此页面(https://globalstudyuk.com/partners2/)上的卡向内层叠。

我们正在使用Divi Wordpress主题。

每行都有以下代码:

div.gallery {
  border: 1px solid #ccc;
}

div.gallery:hover {
  border: 1px solid #777;
}

div.gallery img {
  width: 100%;
  height: auto;
  max-height: 100px;
}

div.desc {
  padding: 15px;
  text-align: center;
}

* {
  box-sizing: border-box;
}

.responsive {
  padding: 0 6px;
  float: left;
  width: 24.99999%;
}

@media only screen and (max-width: 700px) {
  .responsive {
    width: 49.99999%;
    margin: 6px 0;
  }
}

@media only screen and (max-width: 500px) {
  .responsive {
    width: 100%;
  }
}

.clearfix:after {
  content: "";
  display: table;
  clear: both;
}
<div class="responsive">
  <div class="gallery">
    <a target="_blank" href="/partners/solent" rel="noopener noreferrer"><img src="https://globalstudyuk.com/wp-content/uploads/Partners/Solent.jpg" alt="Solent University" width="600" height="400"></a>
    <div class="desc">Solent</div>
  </div>
</div>
<div class="responsive">
  <div class="gallery">
    <a target="_blank" href="/partners/southampton" rel="noopener noreferrer"><img src="https://globalstudyuk.com/wp-content/uploads/Partners/Southampton.jpg" alt="Southampton" width="600" height="400"></a>
    <div class="desc">Southampton</div>
  </div>
</div>
<div class="responsive">
  <div class="gallery">
    <a target="_blank" href="/partners/sunderland" rel="noopener noreferrer"><img src="https://globalstudyuk.com/wp-content/uploads/Partners/Sunderland.jpg" alt="Sunderland" width="600" height="400"></a>
    <div class="desc">Sunderland</div>
  </div>
</div>
<div class="responsive">
  <div class="gallery">
    <a target="_blank" href="/partners/surrey" rel="noopener noreferrer"><img src="https://globalstudyuk.com/wp-content/uploads/Partners/Surrey.jpg" alt="Surrey" width="600" height="400"></a>
    <div class="desc">Surrey</div>
  </div>
</div>

我希望所有行都与第一行一样宽。

0 个答案:

没有答案