1
我仍然在学习CSS和div如何协同工作,并希望模糊效果仅在每次翻转的背景下发生,而不是在覆盖它的红色图像上发生。我不知道最好的方法是什么。layering divs and css
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>
非常感谢你的解释!显然,从你从我的代码中删除的项目中,我仍然在学习我需要的属性以及我不想让它以我想要的方式做出反应。 – 2015-04-01 00:42:45