css鼠标悬浮图片遮罩特效

css

div>div{
    background: rgba(255, 255, 255, 0);
    transition: background 0.3s linear;
}
div:hover>div{
    background: rgba(228, 228, 228, 0.29);
}

html

<div style="width:200px;height:200px;position: absolute;">
    <img src="img/img.jpg" style="width: 100%;height: 100%;"/>
    <div style="position: absolute;width: 100%;height: 100%;top: 0;">div>
div>

你可能感兴趣的:(css)