Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

css - Responsive overlapping images move to the next line

I trying to do responsive overlapping of images that will go to the next line based on the screen size. Instead of moving the images to a new line, it compresses the images and the distance between them. I would like the gap to remain the same and the images to go to a new line. My CSS is basic so hopefully, it's not horrible.

.card-row-wrap {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.card-row-outer {
  display: block;
  top: 40px;
  width: 90%;
}

.card-row {
  position: relative;
  min-height: 220px;
  margin-bottom: 0px;
}

.card {
  float: left;
  position: relative;
  z-index: 100;
  cursor: pointer;
  width: 117px;
  margin-right: -117px;
  margin-bottom: 20px;
  border-radius: 9px;
  left: 0px;
  top: 20px;
  z-index: 100;
  display: inline;
}

.card img {
  height: 220px;
  border-radius: 10px;
  border: grey 2px solid;
}

.card:hover {
  top: 0px;
  filter: brightness(50%);
}

.card-oracle-image-hidden {
  display: none;
}
<div class="cards-row-wrap">
  <div class="card-row-outer">
    <div class="card-row">
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
      <span class="card" style="margin-left: 4%;">
        <img src="https://picsum.photos/200/300" />
      </span>
    </div>
  </div>
</div>
question from:https://stackoverflow.com/questions/65910084/responsive-overlapping-images-move-to-the-next-line

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...