我正在尝试默认情况下将图像设为灰度,并将鼠标悬停淡入颜色。考虑到我希望悬停只与图像相关联,我遇到了问题。
/* MAKE ALL FEATURED IMAGES BLACK AND WHITE */
.banner-wrap .featured-thumbnail {
width: 270px !important;
height: 149px !important;
}
.featured-thumbnail img{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 3.5+ */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */
}
.featured-thumbnail img:hover{
filter: none;
-webkit-filter: grayscale(0%);
}