css定位鼠标划动不动,css实现鼠标移入滑动显示功能

鼠标移上去,元素位置移动,显示隐藏功能效果。(推荐在火狐或谷歌中观看,会有有动画效果)

效果如图:

f9af170b4178884afc20d8d1cc3a0fa9.gif

css:

.box {

width: 200px;

height: 300px;

position: relative;

margin: 200px auto 0 auto;

}

.box:hover .img {

top: -45px;

-moz-transition: all 0.3s ease-in;

-webkit-transition: all 0.3s ease-in;

-o-transition: all 0.3s ease-in;

transition: all 0.3s ease-in;

}

.img {

width: 192px;

height: 292px;

position: absolute;

top: 0;

left: 0;

padding: 3px;

border: 1px solid #e5e5e5;

-moz-transition: all 0.3s ease-in;

-webkit-transition: all 0.3s ease-in;

-o-transition: all 0.3s ease-in;

transition: all 0.3s ease-in;

}

.img div {

width: 192px;

height: 292px;

background: #f7f7f7;

}

.btn {

width: 70px;

height: 25px;

line-height: 25px;

position: absolute;

display: block;

left: 50%;

bottom: 10px;

margin-left: -35px;

background: #ff464f;

text-decoration: none;

text-align: center;

font-size: 12px;

color: #fff;

}

html:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值