取消了对额外元素的需求,同时使内容适合于文档流,而不是像其他解决方案那样是固定的/绝对的。
实现使用.content {
overflow: auto;
position: relative;}
溢出自动是必要的,否则背景将被抵消在顶部的几个像素。
在这之后你只需要.content:before {
content: "";
position: fixed;
left: 0;
right: 0;
z-index: -1;
display: block;
background-image: url('img-here');
background-size:cover;
width: 100%;
height: 100%;
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
filter: blur(5px);}
编辑如果您对删除边缘的白色边框感兴趣,请使用110%左上角-5%..这将放大你的背景一点-但不应该有坚实的颜色出血从边缘。