As I continue to learn about the relationship between CSS and divs, I am facing a challenge with creating a blur effect that only affects the background of each rollover, not the red image overlaying it. I am unsure of the best approach to solve this issue.
Check out the code on jsfiddle
CSS:
.bg {
width:100%;
padding:70px 0px 70px 0px;
}
.wrapper {
width:94%;
max-width:800px;
margin:0px auto;
}
.itemLeft {
width:48%;
background-color:#777;
float:left;
margin-left:1%;
margin-right:1%;
}
.item {
width:100%;
background-position:center center;
text-align:center;
background-image:url("http://lorempixel.com/300/150/sports/");
background-repeat: no-repeat;
}
.item img {
text-align:center;
}
.item:hover {
cursor:pointer;
width:100%;
background-position:center center;
text-align:center;
background-image:url("http://lorempixel.com/300/150/sports/");
background-repeat: no-repeat;
filter: blur(5px);
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
}
HTML:
<div class="bg">
<div class="wrapper">
<div class="itemLeft">
<div class="item">
<img src="http://placehold.it/128x150/a00000" />
</div>
</div>
<div class="itemLeft">
<div class="item">
<img src="http://placehold.it/128x150/f00000" />
</div>
</div>
</div>
</div>