Safari 宽度问题
有没有办法修复 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.
/* -----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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论