鼠标经过,不会旋转
请问老师,不知道是什么问题,div不会旋转
<!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-property: transform;
-o-transition-property: transform;
-moz-transition-property: transform;
transition-property: transform;
}
/*此处写代码*/
div:hover{
width: 400px;
height: 100px;
background: yellow;
transform: rotate(180deg);
-webkit-transition-property: transform;
-o-transition-property: transform;
-moz-transition-property: transform;
transition-property: transform;
transition-timing-function: ease-in-out;
}
</style>
</head>
<body>
<div>www.imooc.com</div>
</body>
</html>17
收起
正在回答
2回答
边框不旋转?这里是选择的div整体哦。让你观察字体,是看字体最后的反过来的,证明是有旋转的,只是没有过度,所以看不到旋转的过程。
祝学习愉快~
HTML5与CSS3实现动态网页 2018
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程

恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星