zoukankan      html  css  js  c++  java
  • [前端]背景上升效果,html+css

    给我一个渐变的效果

    鼠标移入能看到效果

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
        <title></title>
        <style type="text/css">
        .d1{width: 200px;
            height: 200px;
            background: green;
            position: relative;
            overflow: hidden;
    
            }    
            .d2{width: 200px;
            height: 200px;
            z-index: 1;
            position: absolute;
            }
    .d2:before{content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        top: 100%;
        background: red;
        z-index: -2;
        transition: all 0.5S linear;}
    .d2:hover:before{top: 0%}
        </style>
    
    </head>
    <body>
    <div class="d1">
        <div class="d2">给我一个渐变的效果</div>
    </div>
    </body>
    </html>
    只有让自己变得优秀,才有资格对这个世界指手画脚。
  • 相关阅读:
    Linux常用命令-学习笔记
    Linux 输入输出重定向
    Linux 网卡配置参数
    JS Promise对象学习
    Linux用户身份与文件权限学习笔记
    4、点击事件
    3、自定义按压效果
    2、自定义背景形状
    1、文字大小,颜色
    5、跑马灯
  • 原文地址:https://www.cnblogs.com/alasq/p/5894840.html
Copyright © 2011-2022 走看看