html - 图像在移动 View 上显示不正确

标签 html image css mobile

我的问题是关于移动设备中的图像 ( Photo Two ) 没有按要求一张一张地显示,并且越过了“元素”部分的高度限制并下降到“联系人”部分。有人可以建议我一个解决方案吗?在 Photo One您可以看到它们在桌面 View 中的显示方式。

#projects {
  width: 100%;
  height: 100vh;
  background-color: #eee;
}

.img-wrap {
  padding-top: 20px;
  display: flex;
  position: relative;
  overflow: hidden;
}

.img-img {
  border-radius: 12px;
  max-width: 270px;
  width: 100%;
}
<div id="projects">
  <div class="container">
    <h1 class="work-title-1">My Recent Work</h1>
    <h2 class="work-title-2">"Here are a few recent design projects. Want to see more?"
      <a href="#">Email me.</a>
    </h2>
    <div class="row">
      <div class="col-sm-4">
        <div class="img-wrap">
          <img class="img-img" src="images/04.png">
          <p class="img-description">Blockchain pioneers bringing transparency, trust, and security to supply.
            <br><button class="btn"><a class="img-link" href="https://www.google.com/" target="_blank">Visit Website  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a></button>
          </p>
        </div>
      </div>
      <div class="col-sm-4">
        <div class="img-wrap">
          <img class="img-img" src="images/04.png">
          <p class="img-description">Blockchain pioneers bringing transparency, trust, and security to supply.
            <br><button class="btn"><a class="img-link" href="https://www.google.com/" target="_blank">Visit Website  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a></button>
          </p>
        </div>
      </div>
      <div class="col-sm-4">
        <div class="img-wrap">
          <img class="img-img" src="images/04.png">
          <p class="img-description">Blockchain pioneers bringing transparency, trust, and security to supply.
            <br><button class="btn"><a class="img-link" href="https://www.google.com/" target="_blank">Visit Website  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a></button>
          </p>
        </div>
      </div>
      <div class="col-sm-4">
        <div class="img-wrap">
          <img class="img-img" src="images/04.png">
          <p class="img-description">Blockchain pioneers bringing transparency, trust, and security to supply.
            <br><button class="btn"><a class="img-link" href="https://www.google.com/" target="_blank">Visit Website  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a></button>
          </p>
        </div>
      </div>
    </div>
  </div>
</div>

最佳答案

如果您使用 flex 使它们一一显示,我建议您使用:

.row {
 display: flex;
 flex-direction: column;
}

如果您不想让它们在电脑上一一显示,请尝试为每种类型的屏幕使用具有适当宽度的@media screen。对于 PC 使用:flex-direction : row

希望对你有所帮助

问候。

关于html - 图像在移动 View 上显示不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50256816/

相关文章:

html - css 箭头后面的半透明矩形

css - Materialize 使 slider 图像响应

html - 选择具有特定类别的奇数 child

javascript - 在没有元素时隐藏无序列表

JavaScript 追加子项 : Undefined is not a function

javascript - 如何将 jquery 代码转换为可重用的插件/函数

jquery - 显示多个隐藏的 div

python - 屏幕抓取图像(即 Firefox 页面信息/谷歌图像)

mysql - 如何将图像/文件存储在通过表单输入的文件夹中并将地址保存到sql DB?

drop-down-menu - 下拉 CSS 菜单(子链接隐藏)