zoukankan      html  css  js  c++  java
  • 关闭二维码

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
            .box {
                position: relative;
                 74px;
                height: 88px;
                border: 1px solid #ccc;
                margin: 100px auto;
                font-size: 12px;
                text-align: center;
                color: #f40;
                /* display: block; */
            }
    
            .box img {
                 60px;
                margin-top: 5px;
            }
    
            .close-btn {
                position: absolute;
                top: -1px;
                left: -16px;
                 14px;
                height: 14px;
                border: 1px solid #ccc;
                line-height: 14px;
                font-family: Arial, Helvetica, sans-serif;
                cursor: pointer;
            }
        </style>
    </head>
    
    <body>
    <div class="box">
        淘宝二维码
        <img src="image/tao.png" alt="">
        <i class="close-btn">×</i>
    </div>
    <script>
        // 1. 获取元素
        var btn = document.querySelector('.close-btn');
        var box = document.querySelector('.box');
        // 2.注册事件 程序处理
        btn.onclick = function() {
            box.style.display = 'none';
        }
    </script>
    </body>
    
    </html>
  • 相关阅读:


    查看linux内核版本信息
    netstat常用命令
    cpuinfo和lscpu查看CPU相关的信息
    Openstack的命令
    iptables常用命令及应用
    RPC-server的创建过程
    RabbitMQ and Oslo.messaging
    Python中的cls与self的区别
  • 原文地址:https://www.cnblogs.com/fuyunlin/p/14440055.html
Copyright © 2011-2022 走看看