快捷搜索:   MySQL PHP linux 播放器

css 图片鼠标滑动放大

css 图片鼠标滑动放大

transition: all 1s; 
background-size: cover;
transform: scale(1.1);
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学新通示例</title>
    <style>
        *, body, html {
            margin: 0; padding: 0;
        }
        img {
            width: 300px;
            overflow: hidden;
            margin: 0 auto;
        }
        img:hover {
            transition:all 2s;/*图片放大过程的时间*/
            cursor: crosshair;
            transform: scale(1.9);  /*以y轴为中心旋转*/
        }
    </style>
</head>
<body>
    <div id="img">
        <img src="https://blog.swvq.com/Uploads/image/WebWechat/202011/28/1606545110.jpg" alt="">
    </div>
</body>
</html>



您可能还会对下面的文章感兴趣: