Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 背景视频在父div外推送_Html_Css - Fatal编程技术网

Html 背景视频在父div外推送

Html 背景视频在父div外推送,html,css,Html,Css,遇到在特定窗口宽度(约1100px)以下的问题 我的网站标题页的背景视频开始出现问题。这很难解释,但是在第一个div(标题容器)和下面的一个div(关于容器)之间出现了一个无法解释的间隙。 测试服务器地址是:mintrain。有限公司。英国 任何帮助都会很好。我读过《模拟背景大小:html5视频的封面》,但它并不能解决div高度有限的问题。谢谢,杰克,不要让位置是绝对的,而是让位置固定。这将解决您的尺码问题 #bgvideo { position: fixed; transfor

遇到在特定窗口宽度(约1100px)以下的问题 我的网站标题页的背景视频开始出现问题。这很难解释,但是在第一个div(标题容器)和下面的一个div(关于容器)之间出现了一个无法解释的间隙。 测试服务器地址是:mintrain。有限公司。英国


任何帮助都会很好。我读过《模拟背景大小:html5视频的封面》,但它并不能解决div高度有限的问题。谢谢,杰克,不要让位置是绝对的,而是让位置固定。这将解决您的尺码问题

#bgvideo {
    position: fixed;
    transform: translate(-50%,-50%);
    background-color: #232528;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    top: 50%;
    left: 50%;
}

@media only screen and (max-width: 1000px) {
#bgvideo {
    position: absolute;
    transform: translate(-50%,-50%);
    background-color: #232528;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    top: 50%;
    left: 50%;
} }

谢谢你的回复!在浏览器宽度达到431px之前一直都很好用。我会再看一看!我添加了一个媒体规则,这可能不是让它工作的最佳方式,但它解决了两个问题@杰克斯科特