【发布时间】:2018-10-20 18:04:41
【问题描述】:
我正在制作这个电影网站并添加背景。 即使我向下滚动,我也希望背景能够重复并覆盖整个页面,但由于某种原因我无法修复它。 我尝试搜索它并尝试了从谷歌获得的所有解决方案,但都是徒劳的。这是我的背景图片代码。我尝试将背景重复的值更改为重复-y,但仍然没有用。 关于做什么的任何提示?
/*------ Background image ------*/
.bg-image {
/* The image used */
background-image: url("bgd.jpg");
/* Add the blur effect */
filter: blur(4px);
-webkit-filter: blur(4px);
/* Full height */
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
/* ------------------------ */
【问题讨论】:
-
如果你想让背景重复设置
background-repeat为repeat -
此外,如果您希望背景保持滚动时的状态,请使用
background-attachment:fixed -
@AbdullahRazzaki 我试过这个但没用
-
尝试:background-repeat: repeat-y;
-
@lulius 没有变化 :(