FavoriteLoading
0

CSS之鼠标悬停——(图片)内容变深/变浅

分别制作两套样式,鼠标悬停(hover)和默认状态时 变深设置:

.img{ filter: alpha(Opacity=60); opacity: 0.6; }
.img:hover{ filter: alpha(Opacity=100); opacity: 1; }  
变浅设置:
.img{ filter: alpha(Opacity=100); opacity: 1; }
.img:hover{ filter: alpha(Opacity=60); opacity: 0.6; }  
说明:利用opacity属性,设置 div 元素的不透明级别
.img:hover{ filter: alpha(Opacity=100); opacity: 1; }  
变浅设置:
.img{ filter: alpha(Opacity=100); opacity: 1; }
.img:hover{ filter: alpha(Opacity=60); opacity: 0.6; }  
说明:利用opacity属性,设置 div 元素的不透明级别