zoukankan      html  css  js  c++  java
  • 鼠标hover时改变图片透明度和颜色

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>鼠标hover时改变图片透明度和颜色</title>
    <style>
    * {
    margin:0;
    padding: 0;
    }

    .wrap{
    border: 1px solid pink;
    300px;
    height:250px;
    position: relative;
    overflow: hidden;
    }
    .pic,.bac {
    300px;
    height:250px;
    position: absolute;
    }
    .bac {
    background: pink;
    opacity: 0.6;
    display: none;
    }
    img {
    300px;
    height:250px;
    }
    .wrap:hover .bac{
    display: block;
    }
    .wrap:hover .txt{
    display: block;
    }
    .txt {
    font-size: 40px;
    position: absolute;
    text-align: center;
    left: 50%;
    top:30%;
    color:orangered;
    display: none;
    }
    </style>
    </head>
    <body>
    <div class="wrap">
    <div class="pic">
    <img src="img/1.png">
    </div>
    <div class="bac"></div>
    <div class="txt">+</div>
    </div>
    </body>
    </html>
  • 相关阅读:
    Gitbook
    Docker命令
    sd
    文本三剑客
    2017.4.12下午
    2017.4.11下午
    2017.4.11上午
    2017.4.10下午
    2017.4.10上午
    2017.4.7下午
  • 原文地址:https://www.cnblogs.com/iriliguo/p/6477401.html
Copyright © 2011-2022 走看看