我试图从白色淡化背景图像而不淡化内容.
这就是我所拥有的:
.my-container {
position: relative;
background: white;
overflow: hidden;
background-repeat: no-repeat;
width: 100%;
height: 100%;
background-size: cover;
background-image: url('http://placekitten.com/1500/1000');
}
/* You could use :after - it doesn't really matter */
.my-container:before {
content: ' ';
display: block;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
opacity: 1;
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
background-repeat: no-repeat;
background-position: 50% 0;
background-size: cover;
}
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch
Scotch Scotch Scotch