1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 鼠标悬浮图片特效

鼠标悬浮图片特效

时间:2021-03-21 11:59:33

相关推荐

鼠标悬浮图片特效

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>背景图片悬浮放大</title><style>*{padding: 0px;margin: 0px;}.container{width: 80%;margin: 50px auto;color: #FFFFFF;}.item-wrap{position: relative;width: 290px;height: 280px;overflow: hidden;display: inline-block;}.item{width: 100%;height: 100%;transition: all 0.5s;}.item-wrap:hover .item{transform: scale(1.1);}.item-inner{width:100%;height:100%;background: rgba(0, 0, 0, 0) linear-gradient(10deg, rgba(0, 0, 0, 0.8) 15%, rgba(0, 0, 0, 0.15) 51%, rgba(0, 0, 0, 0) 70%) repeat scroll 0 0;}.item-txt{position: absolute;width:100%;bottom: 20px;}.container h2{padding-top: 100px;line-height: 50px;text-align: center;}.item:hover{transform: scale(1.2);}.list-item{position: relative;overflow: hidden;display: inline-block;}.list-item img{width: 100%;height: 100%;transition: all 0.5s;}.list-item .item-info{position: absolute;width:100%;bottom:0px;padding-bottom: 20px;background: rgba(0, 0, 0, 0) linear-gradient(10deg, rgba(0, 0, 0, 0.8) 15%, rgba(0, 0, 0, 0.15) 51%, rgba(0, 0, 0, 0) 70%) repeat scroll 0 0;}.list-item:hover img{transform: scale(1.1);}</style></head><body><div class="container"><div class="item-wrap"><div class="item" style="background: url(img/jpk1.jpg) no-repeat center center;background-size: 100% 100%;"><div class="item-inner"></div></div><div class="item-txt"><h2>Notice:first message</h2><p>Pay attention,please!This is the first message for you.</p></div></div><div class="item-wrap"><div class="item" style="background: url(img/jpk2.jpg) no-repeat center center;background-size: 100% 100%;"><div class="item-inner"></div></div><div class="item-txt"><h2>Notice:first message</h2><p>Pay attention,please!This is the first message for you.</p></div></div></div><!--================这是一道华丽的分割线============--><div class="container"><div class="list-item"><img src="img/jpk1.jpg"/><div class="item-info"><h2>Notice:first message</h2><p>Pay attention,please!This is the first message for you.</p></div></div><div class="list-item"><img src="img/jpk2.jpg"/><div class="item-info"><h2>Notice:Last message</h2><p>Pay attention,please!This is the first message for you.</p></div></div></div></body></html>

效果图:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。