首页 > 代码库 > 鼠标放上去盒子向上滑动

鼠标放上去盒子向上滑动

html:

<div class="box clearfix">       <div class="box1"></div>       <div class="box2"></div>    </div>

css:

.box{height: 500px;width: 500px;background-color: pink;}.box1,.box2{width: 100px;height: 100px;background:red;margin: 30px 30px;float: left;transition: all 0.8s ease;-moz-transition: all 0.8s ease;-webkit-transition: all 0.8s ease;-o-transition: all 0.8s ease;}.box1:hover{margin-top: -10px;}.box2:hover{margin-top: -10px;}

 

鼠标放上去盒子向上滑动