鼠标悬浮图片特效

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

 

效果图:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值