zoukankan      html  css  js  c++  java
  • 仿照小米横向特效和弹出二维码

    一、仿照小米横向特效

    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>仿小米横向特效</title>
        <style>
            .box{
                width: 200px;
                height: 300px;
                background-color: orchid;
                position: relative;
            }
            .hidden{
                display: none;
                width: 400px;
                height: 300px;
                background-color: orangered;
                position: absolute;
                top: 0;
                left: 100%;
            }
            .box:hover .hidden{
                display: block;
            }
        </style>
    </head>
    <body>
        <div  class="box">
            <div  class="hidden"></div>
        </div>
    </body>
    </html>

     实现效果:(鼠标移动到上面之后弹出橙色区域部分)

     二、弹出二维码

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>二维码弹出</title>
        <style>
        .box{
            width:200px;
            margin:220px;
            position:relative;
            text-align:center;
            background:#eea;
        }
        .hidden{
            width:200px;
            height:200px;
            display:none;
            position:absolute;
            bottom:100%;
            left:0px;
        }
        .box:hover .hidden{
            display:inline-block;
        }
        </style>
    </head>
    <body>
        <div class="box">百度二维码
            <div class="hidden"><img src="baidu.jpg"></div>
        </div>
    </body>
    </html>

     实现效果:(鼠标移动到上面之后弹出百度的二维码)

    之所以能实现弹出效果,是因为为子元素设置  display:none  属性

    display:none —— 不为隐藏的对象保留其原来的位置,使其在页面上消失;

    然后使用:hover属性当鼠标悬停在父元素 .box 上时设置子元素.hidden的样式为display:block  使子元素出现在页面。

  • 相关阅读:
    调用Config.ini类
    winform用AForge拍照功能
    winform导出csv
    winform导出excel
    net里面using的使用
    DBNULL与null的区别
    mui app在线更新
    redux-thunk初步使用
    初步使用Web Notification 实现浏览器消息通知
    ios唤起键盘后,页面不收回导致元素错位的问题.(譬如固定在底部的自定义键盘等)
  • 原文地址:https://www.cnblogs.com/nyw1983/p/11663343.html
Copyright © 2011-2022 走看看