<html>
<head>
<meta charset="utf-8">
<title>css实现鼠标移入时的放大效果title>
<style type="text/css">
div{
width: 200px;
height: 300px;
margin:0 auto;
margin-top: 100px;
}
div img{
width: 100%;
height: 100%;
transition: all 0.6s; //设置动画执行的时间为0.6s
cursor: pointer;
}
div img:hover{
transform: scale(1.2); //设置图片按照比例放大1.2倍
}
style>
head>
<body>
<div>
<img src="images/unnamed.jpg">
div>
body>
html>
0条评论