码迷,mamicode.com
首页 > Web开发 > 详细

css3 鼠标经过外层阴影

时间:2015-03-06 09:31:10      阅读:315      评论:0      收藏:0      [点我收藏+]

标签:

 

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body{
    background-color: #eee;
}
.box{
    width: 200px;
    height: 350px;
    background-color: #fff;
    position: relative;
}
.box:hover{
    box-shadow:0 0 18px rgba(0,0,0,0.4);
}
.box:hover:before{position:absolute; content:""; bottom:10px; left:0; height:20px; width:50%; box-shadow:0 15px 10px rgba(0,0,0,0.3); -webkit-transform:rotate(-6deg); -moz-transform:rotate(-6deg); -o-transform:rotate(-6deg); -ms-transform:rotate(-6deg); transform:rotate(-6deg); z-index:-1}
.box:hover:after{position:absolute; content:""; bottom:10px; left:0; height:20px; width:50%; box-shadow:0 15px 10px rgba(0,0,0,0.3); -webkit-transform:rotate(-6deg); -moz-transform:rotate(-6deg); -o-transform:rotate(-6deg); -ms-transform:rotate(-6deg); transform:rotate(-6deg); z-index:-1;right:0; left:auto; -webkit-transform:rotate(6deg); -moz-transform:rotate(6deg); -o-transform:rotate(6deg); -ms-transform:rotate(6deg); transform:rotate(6deg)}
</style>
</head>
<body>
    <div class="box"></div>
</body>
</html>

 

效果如下图所示:

技术分享

css3 鼠标经过外层阴影

标签:

原文地址:http://www.cnblogs.com/baixc/p/4317227.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!