0
因此,我想让我的背景覆盖整个屏幕并保持固定,但我想使用background-size: cover
使其适合不同的屏幕比例。不幸的是,filter: blur()
增加了一个令人讨厌的模糊的边缘,我不想要的照片,所以我正在寻找一种方法来解决它。在stackoverflow上,建议通常是将图片的边缘移出视口,但显然background-size: cover
根本不起作用。有另一种方法吗?获取过滤器的定义边缘:带背景覆盖的模糊图像
CSS片段:
#background {
position: fixed;
height: 100%;
width: 100%;
filter: blur(5px); //blur
background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5)), url("../Resources/img/background-medium.jpg") no-repeat center 35% fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
(#background
只是一个空格)
太棒了,工作!谢谢。 – Rmo