设置鼠标悬停图片放大效果
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> #div1{ width: 200px; height: 138px; border: #000 solid 1px; overflow: hidden; } #div1 img{ cursor: pointer; transition: all 1.1s; } #div1 img:hover{ transform: scale(1.2); } </style> </head> <body> <div id="div1"> <img src="demo.jpg" /> </div> </body> </html>