zoukankan      html  css  js  c++  java
  • hover实战

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>hover</title>
    <meta charset="UTF-8">
    <style>
    .container{
    background-color: #45beff;
    }
    .container .item{
    background-color: #ee5555;
    150px;
    height:180px;
    border:1px solid yellow;
    /*overflow: hidden;!*将图片超出部分收起来*!*/
    position: relative;/*absolute会向上找,找到有relative的,并将其覆盖*/
    }
    .left{
    float:left;
    }
    .clearfix:after{
    content:'.';
    clear:both;
    display: block;
    visibility: hidden;
    height:0;

    }
    .container .item:hover{
    border: 1px solid black;
    }
    .container .item .text{
    display: none;

    }
    .container .item:hover .text{
    display: block;

    }

    </style>


    </head>
    <body>
    <div class="container clearfix">
    <div class="item left">
    <div class="bg">
    <img style=" 150px;height: 180px;" src="1.jpg">
    </div>
    <div class="text">
    <div style="z-index:9;position: absolute;top:0;right: 0;bottom: 0;left:0;background-color: black;opacity:0.6"></div>
    <div style="z-index:10;position: absolute;top:0;right: 0;bottom: 0;left:0;">150</div>
    </div>
    </div>
    <div class="item left">
    <div>
    <img style=" 150px;height: 180px;" src="1.jpg">
    </div>
    <div class="text">
    <div style="z-index:9;position: absolute;top:0;right: 0;bottom: 0;left:0;background-color: black;opacity:0.6"></div>
    <div style="z-index:10;position: absolute;top:0;right: 0;bottom: 0;left:0;">150</div>
    </div>
    </div>
    <div class="item left">
    <div>
    <img style=" 150px;height: 180px;" src="1.jpg">
    </div>
    <div class="text">
    <div style="z-index:9;position: absolute;top:0;right: 0;bottom: 0;left:0;background-color: black;opacity:0.6"></div>
    <div style="z-index:10;position: absolute;top:0;right: 0;bottom: 0;left:0;">150</div>
    </div>
    </div>
    </div>

    </body>
    </html>



  • 相关阅读:
    阿里云https证书Apache配置
    srvany.exe读取配置文件问题
    outlook检查姓名快捷键
    PHP ftp获取目录内容为空
    php 导出csv表格文件
    lnmp 多站点配置负载均衡
    rabbitmq集群方案
    如何让docker以daemon方式运行/bin/bash
    [mutt] Configure mutt to receive email via IMAP and send via SMTP
    linux邮件客户端mutt日志文件,发不出邮件
  • 原文地址:https://www.cnblogs.com/startl/p/12322316.html
Copyright © 2011-2022 走看看