【发布时间】:2019-02-27 09:54:25
【问题描述】:
当用户将鼠标悬停在 .png 上方时,我不知道如何立即旋转和缩放它。现在它只有在我将鼠标悬停在图片上时才会缩放。我知道规模会覆盖第一个转换,但我不知道如何解决这个问题。我不认为@keyframes 在这种情况下是正确的,因为图片不会从一个地方移动到另一个地方,还是我错了?当我停止悬停时,它又变大了。不旋转。
提前谢谢你。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="CSS/stylesheet-7.css"/>
</head>
<body>
<div class="circle">
<img src="Images/hypnotic.png">
</div>
</body>
</html>
样式表:
html {
background: ##99ccff;
}
.circle img {
transition: 6s;
}
.circle img:hover {
transform: rotate(720deg);
transform: scale(0.3);
}
【问题讨论】:
标签: html css rotation hover scale