Here is the jsfiddle and HTML:
<div class="wrapper">
<div class="blur"></div>
<div class="content">
text<br>
text<br>
text<br>
text<br>
text<br>
text<br>
text<br>
text<br>
text<br>
</div>
</div>
and CSS:
.wrapper{
position: relative;
width: 300px;
height: 100px;
margin: 100px auto;
background-color: #C0C0C0;
overflow-x: hidden;
overflow-y: auto;
}
.blur{
width: 400px;
height: 50px;
position: absolute;
background-color: #000000;
-webkit-filter: blur(10px);
-ms-filter: blur(10px);
-o-filter: blur(10px);
-moz-filter: blur(10px);
filter: blur(10px);
left: -50px;
top: -20px;
}
How to keep .blur element fixed top within .wrapper element when I scroll .content element? I think jquery scrollTop might be a solution. Could anyone tell me how to do this?