【发布时间】:2020-04-08 10:43:53
【问题描述】:
我喜欢翻译并将h1 元素旋转到它的位置。但是翻译不起作用,并且在旋转文本时会离开它的位置并返回,但我希望它一直在它的位置。
代码:
.article1 h1{
font-size: 50px;
font-weight: 600;
margin-top: 130px;
margin-bottom: 12px;
animation: tilt 2s ease 3;
}
@keyframes tilt{
0% {
transform: translateY(200px);
transform: rotateY(0deg);
opacity: 0.2;
}
100% {
transform: translateY(0px);
transform: rotateY(360deg);
opacity: 1;
}
}
我需要 h1 从 200px 顶部到达它的位置,并在下降时进行 360 度 Y 旋转,这可能吗?
【问题讨论】:
-
可以分享你的html代码吗?
-
<article class="article1"> <h1>What we do.</h1> <h3>We provide Top-Quality Plants you choose right to your doorstep</h3> <button class="button">Explore</button> </article> -
你可以做嵌套的 div 并在每个上放一个动画。
标签: css css-animations css-transitions