为什么这么写,鼠标滑过的时候只会放大而不会旋转
来源:3-3 编程练习
qq_云水边静沐暖阳_04205942
2018-04-12 17:15:12
这么写鼠标滑过只会放大却不旋转,transform: scale(2) rotate(180deg);而我把360改成180就会旋转,或者把两个分开transform: scale(2);transform: rotate(360deg);这样才会一边变大一边旋转,想不明白
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>3-1作业</title>
<style>
div {
font-size: 14px;
font-weight: bold;
line-height: 50px;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 200px;
height: 50px;
margin: auto;
cursor: pointer;
text-align: center;
background: #abcdef;
transform:rotate(0deg);
-webkit-transition: transform 1s ease 1s;
-moz-transition: transform 1s ease 1s;
-ms-transition: transform 1s ease 1s;
-o-transition: transform 1s ease 1s;
transition: transform 1s ease 1s;
}
div:hover{
transform: scale(2) rotate(180deg);
-webkit-transition: transform 1s ease 1s;
-moz-transition: transform 1s ease 1s;
-ms-transition: transform 1s ease 1s;
-o-transition: transform 1s ease 1s;
transition: transform 1s ease 1s;
}
</style>
</head>
<body>
<div>www.imooc.com</div>
</body>
</html>
1回答
过渡的设置,最好前后一致,如下:
相似问题