Safari 宽度问题

发布于 2025-01-16 14:06:18 字数 3390 浏览 3 评论 0原文

有没有办法修复 Safari 对我网页视频的操作(如下图所示)?它在 Chrome 中运行良好......我尝试了许多不同的“解决方案”但没有成功。我认为问题在于宽度,但我找不到一种方法让这些视频适合 iPhone。

示例

/* -----TRABAJOS----- */
.row1 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 5px;
}

.trabajo-video {
  width: 480px;
  height: 270px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
  transition: transform 1s, opacity 1s;
  flex: 0 1;
}

.trabajo-video iframe {
  transition: 0.2s linear;
  opacity: 0.8;
}

.trabajo-video iframe:hover {
  opacity: 1;
}

@media only screen and (max-width: 767px) {
 .trabajo-video {
    border: none;
    box-shadow: none;
  }
  .trabajo-video iframe {
    opacity: 1;
    width: 95vw;
  }
}  
 <section class="section-trabajos js--section-trabajos" id="trabajos">
            <div class="row1">
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/394267911?h=d0dc5419b7" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/601058658?h=ca99e9cfff" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/554312785?h=d02669a5e8" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/548861510?h=79744afee2" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/611892549?h=a8c3f6376d" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/507199207?h=44dc935b21" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/626691091?h=2ca8780c56" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/275921049?h=fff1d08a02" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/507209760?h=99b7a40f5a" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
            </div>  
        </section>

Is there a way to fix what Safari is doing to the videos of my web page (shown on the picture below)? It works fine in chrome..I've tried many different "solutions" without success. I think the problem is the width, but i cant find a way to make those videos fit in iphones.

example

/* -----TRABAJOS----- */
.row1 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 5px;
}

.trabajo-video {
  width: 480px;
  height: 270px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
  transition: transform 1s, opacity 1s;
  flex: 0 1;
}

.trabajo-video iframe {
  transition: 0.2s linear;
  opacity: 0.8;
}

.trabajo-video iframe:hover {
  opacity: 1;
}

@media only screen and (max-width: 767px) {
 .trabajo-video {
    border: none;
    box-shadow: none;
  }
  .trabajo-video iframe {
    opacity: 1;
    width: 95vw;
  }
}  
 <section class="section-trabajos js--section-trabajos" id="trabajos">
            <div class="row1">
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/394267911?h=d0dc5419b7" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/601058658?h=ca99e9cfff" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/554312785?h=d02669a5e8" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/548861510?h=79744afee2" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/611892549?h=a8c3f6376d" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/507199207?h=44dc935b21" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/626691091?h=2ca8780c56" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/275921049?h=fff1d08a02" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
                <div class="trabajo-video"><iframe src="https://player.vimeo.com/video/507209760?h=99b7a40f5a" width="480" height="270" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
            </div>  
        </section>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文