gpt4 book ai didi

html - 试图让这个 div 在加载时旋转

转载 作者:太空宇宙 更新时间:2023-11-04 02:16:50 24 4
gpt4 key购买 nike

我看不出有什么问题...但是 div 没有旋转

<!DOCTYPE html>
<html>
<head>

<link href='http://fonts.googleapis.com/css?family=Lato:900' rel='stylesheet' type='text/css'>

<style type="text/css">

.rotate
{

margin:121px 149px;

width:483px;
height:298px;

background:#676470;
color:#fff;
font-family:Tahoma;
font-size:2em;

text-align:center;

transition:all 5s ease;

-webkit-transform: rotateZ(-3240deg);
-ms-transform: rotateZ(-3240deg);
transform: rotateZ(-3240deg);

}

.rotate div {
padding-top: 3em;
}

.rotate:active
{
}

</style>
</head>
<body>

<div class="rotate"><div>Hello</div></div>

</body>
</html>

最佳答案

您要找的是 CSS3 animations .

这是您的示例的演示:


代码片段:

.rotate {
margin: 121px 149px;
width: 483px;
height: 298px;
background: #676470;
color: #fff;
font-family: Tahoma;
font-size: 2em;
text-align: center;
animation: rotateZ 5s;
}
.rotate div {
padding-top: 3em;
}
@keyframes rotateZ {
to {
transform: rotateZ(-3240deg);
}
}
<div class="rotate">
<div>Hello</div>
</div>


JSFIDDLE

关于html - 试图让这个 div 在加载时旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38778386/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com