Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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 整个网站长度上的白色背景_Html_Css - Fatal编程技术网

Html 整个网站长度上的白色背景

Html 整个网站长度上的白色背景,html,css,Html,Css,我的网站内容存在显示问题。 我正在创建一个网站,它在浏览器上显示得很好(宽度100%),但当我调整浏览器屏幕的大小时,我用底部滚动条向右侧过渡,出现了白色背景。 我没有使用响应技术。 我使用固定的容器宽度(宽度:1170px;边距:0 auto;) 网站:如果您没有使用响应式设计,请在标题中使用固定的with .top_header { background-color: #222d68; width: 1170px; height: 45px; } 使滑块和主容器也具有固定宽度 #slide

我的网站内容存在显示问题。 我正在创建一个网站,它在浏览器上显示得很好(宽度100%),但当我调整浏览器屏幕的大小时,我用底部滚动条向右侧过渡,出现了白色背景。 我没有使用响应技术。 我使用固定的容器宽度(宽度:1170px;边距:0 auto;)


网站:

如果您没有使用响应式设计,请在标题中使用固定的with

.top_header {
background-color: #222d68;
width: 1170px;
height: 45px;
}
使滑块和主容器也具有固定宽度

#slideshow {
float: left;
width: 1170px;
position: relative;
z-index: 8;
border-bottom: 3px solid rgb(194, 194, 194);
}

main {
background-image: url("../img/backgrounds/main_bg.jpg");
background-repeat: no-repeat;
height: 1075px;
float: left;
width: 1170px;
}
让页脚

.bottom_footer {
width: 1170px;
height: 45px;
background-color: #222222;
float: left;
}

将背景尺寸:封面添加到主屏幕

main{
   background-size: cover;
}

我可以通过向
main
自定义元素添加额外样式来清除白色背景:

-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
 background-size: cover;

还添加了用于跨浏览器支持的前缀。

测试使用的浏览器(和版本)是什么?我正在使用Google Chrome,最新版本。请您回答,它部分解决了这个问题,但我不想更改例如顶部标题的宽度,我想,这个元素必须始终有100%的宽度浏览器的问题是,你的网站有一些流动和固定的元素。您的容器类的宽度为1170px。它使水平滚动条出现,因此,所有宽度为100%的元素将跟随屏幕,使白色背景出现。你应该让容器有100%的宽度,并做一些调整,使你的网站更流畅。我不明白为什么这个答案得到这么多的反对票。他说他没有使用响应元素,所以他应该用固定宽度制作所有类。