【发布时间】:2015-09-21 20:15:37
【问题描述】:
我正在为屏幕的每个角落设置动画文本。在每个角落,文本都被旋转。这里的问题是,在右上角和左下角,文本离开了屏幕。我认为这与旋转有关。
我的问题是如何将全文以正确的位置显示在屏幕上?
#lorem {
font-size: 50px;
color: red;
position: absolute;
top: 5%;
left: 5%;
animation: switch 10s linear infinite;
}
@keyframes switch {
0% {
bottom:auto;
top:3%;
left: 3%;
right: auto;
animation-timing-function: steps(1, end);
}
25% {
left:auto;
right:3%;
bottom: auto;
top: 3%;
animation-timing-function: steps(1, end);
transform: rotate(90deg);
}
50% {
top:auto;
bottom:3%;
right: 3%;
left: auto;
animation-timing-function: steps(1, end);
transform: rotate(180deg);
}
75% {
right:auto;
left:3%;
top: auto;
bottom: 3%;
animation-timing-function: steps(1, end);
transform: rotate(-90deg);
}
}
<span id="lorem">Lorem</span>
【问题讨论】:
-
它在 FF 和 Chrome 中的行为不同,很难理解你需要什么
-
您必须更改我怀疑的
transform-origin点。
标签: html css css-animations css-transforms