首页 > Web开发 > 详细

[前端]背景上升效果,html+css

时间:2016-09-22 08:43:54      阅读:314      评论:0      收藏:0      [点我收藏+]
给我一个渐变的效果

鼠标移入能看到效果

<!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>

 

[前端]背景上升效果,html+css

原文:http://www.cnblogs.com/alasq/p/5894840.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!