gpt4 book ai didi

internet-explorer - Internet Explorer 中的全角背景视频

转载 作者:行者123 更新时间:2023-12-03 23:41:08 26 4
gpt4 key购买 nike

我正在设计一个在 100% 宽度的容器中使用自托管背景视频的网站。在 Chrome 和 Firefox 中完美运行,但在 IE 中惨遭失败(在 IE 11 中测试)。

视频应该横向拉伸(stretch)以填充容器 - 保持视频比例,但是,IE 只是将视频以垂直填充容器所需的大小放置在容器中。

Screenshot of video stretching to fill container width in Chrome
Screenshot of video failing to fill container in IE

Link to Page with Error

最佳答案

/*you can use this css.*/

.fullwidth-video {
position: absolute;
top: 0;
left: 0;
z-index: 1;
min-height: 100%;
min-width: 100%;
-webkit-transform-style: preserve-3d;
}
.fullwidth-video video {
position: absolute;
top: 0;
left: 0;
z-index: 1;
min-height: 100%;
min-width: 100%;
height: auto;
width: 100%;
object-fit: cover;
}

html代码在这里...
     <div class="fullwidth-video">
<video preload="auto" autoplay loop muted="">
<source src="http://sawyerfirm.ignitte.com/wp-content/uploads/2015/12/Girl-Riding-In-Car-8-BW.mp4" type="video/mp4">
<source src="http://sawyerfirm.ignitte.com/wp-content/uploads/2015/12/Girl-Riding-In-Car-8-BW.webm" type="video/webm">
</video>
</div>

关于internet-explorer - Internet Explorer 中的全角背景视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34328041/

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