为什么我的变大一倍效果出不来
<!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 2s ease-in-out 1s;
-moz-transition:transform 2s ease-in-out 1s;
-o-transition:transform 2s ease-in-out 1s;
transition:transform 2s ease-in-out 1s;
}
/*此处写代码*/
div:hover {
cursor:pointer;
transform: scale(2,2);
transform: rotate(360deg);
-webkit-transition:transform 2s ease-in-out 1s;
-moz-transition:transform 2s ease-in-out 1s;
-o-transition:transform 2s ease-in-out 1s;
transition:transform 2s ease-in-out 1s;
}
</style>
</head>
<body>
<div>www.imooc.com</div>
</body>
</html>
正在回答 回答被采纳积分+1
<!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: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out; } /*此处写代码*/ div:hover { cursor:pointer; /*transform: scale(2,2);*/ transform: scale(2) rotate(360deg); -webkit-transform: scale(2) rotate(360deg); /*下面的也需要去掉。已经在上面的div中定义了*/ /*-webkit-transition:transform 2s ease-in-out 1s;*/ /*-moz-transition:transform 2s ease-in-out 1s;*/ /*-o-transition:transform 2s ease-in-out 1s;*/ /*transition:transform 2s ease-in-out 1s;*/ } </style> </head> <body> <div>www.imooc.com</div> </body> </html>
希望可以帮到你~
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星