css3之div大小變化


一、hover變大變小

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>hover變大變小</title>
		<style type="text/css">
			*{margin: 0px;padding: 0px;}
			.hover-con{margin: 100px auto;width:300px;text-align: center;border: 1px solid #000000;}
			span{
				display: inline-block;
				margin: 20px;
				width: 80px;
				height: 80px;
				line-height: 80px;
				text-align: center;
				background:#0069D9;
				color: #FFFFFF;
				cursor: pointer;
			}
			.ech-big,.ech-small {
			    transition: all .4s;
			}
			.ech-big:hover{
			    transform: scale(1.2);
			}
			.ech-small:hover{
			    transform: scale(.9);
			}
		</style>
	</head>
	<body>
		<div class="hover-con">
			<span class="ech-big">big</span>
			<span class="ech-small">small</span>
		</div>
		
	</body>
</html>

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM