gpt4 book ai didi

html - iframe 视频与 ios 上的填充容器重叠

转载 作者:行者123 更新时间:2023-11-28 02:09:41 24 4
gpt4 key购买 nike

当我在 ios 手机上访问我的网站时,iframe 视频与其容器的填充重叠并且发生了偏移(请参见下面的屏幕截图)。该问题不会出现在其他手机或计算机上(即使是 chrome 移动版)。我用骨架。

shifted iframe video这是我的 html:

<html lang="en">
<body class="container">
<section class="row">
<div class="twelve columns video-container" title="Funix">
<iframe class="video" src="https://player.vimeo.com/video/209906189" width="1980" height="1114" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
<div class="six columns small-image nomarginleft" title="Sketches" style="background-image:url(/img/project/funix/funix_sketches.jpg)"> </div>
</section>
</body>
</html>

和我的CSS:

html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%; }

body {
font-size: 16px;
font-weight: 400;
font-family: "OpenSans", "Open Sans", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #222;
margin: 0;
}

section {
display: block;
height: auto;
padding-bottom: 35px;
background-color: white;
box-sizing: content-box;
padding-left: 15px;
padding-right: 15px;
}

.columns {
width: 100%;
float: left;
box-sizing: border-box;
}

.video-container {
position: relative;
height: 0;
padding-bottom: 56.25%;
margin-bottom: 15px;
}

.video {
position: absolute;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
}

.small-image {
height: 0;
padding-bottom: 70%;
background-size: cover;
background-position: center;
justify-content: center;
align-items: center;
overflow: hidden;
display: flex;
margin-bottom: 15px;
}

最佳答案

只需为移动设备制作一个响应式媒体查询(甚至可能不需要......)并删除:object-fit: cover; 这就是根源所在。我会检查一下:

https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit

IE等浏览器对它不友好。

关于html - iframe 视频与 ios 上的填充容器重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48832574/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com