gpt4 book ai didi

html - 使用CSS的文本 slider

转载 作者:行者123 更新时间:2023-11-27 23:36:43 25 4
gpt4 key购买 nike

我有一个简单的 3 个文本我想添加这些文本的向下滑动效果这是我目前拥有的 jsfiddle demo

body {
font-family: 'Open Sans', 'sans-serif';
color: #cecece;
background: #222;
overflow: hidden;
}

.item-1,
.item-2,
.item-3 {
position: absolute;
display: block;
top: 2em;
width: 60%;
font-size: 2em;
animation-duration: 20s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}

.item-1 {
animation-name: anim-1;
}

.item-2 {
animation-name: anim-2;
}

.item-3 {
animation-name: anim-3;
}

@keyframes anim-1 {
0%,
8.3% {
left: -100%;
opacity: 0;
}
8.3%,
25% {
left: 25%;
opacity: 1;
}
33.33%,
100% {
left: 110%;
opacity: 0;
}
}

@keyframes anim-2 {
0%,
33.33% {
left: -100%;
opacity: 0;
}
41.63%,
58.29% {
left: 25%;
opacity: 1;
}
66.66%,
100% {
left: 110%;
opacity: 0;
}
}

@keyframes anim-3 {
0%,
66.66% {
left: -100%;
opacity: 0;
}
74.96%,
91.62% {
left: 25%;
opacity: 1;
}
100% {
left: 110%;
opacity: 0;
}
}
<p class="item-1">Fast.</p>

<p class="item-2">Slow</p>

<p class="item-3">Much slow</p>
我有一个简单的 3 个文本我想添加这些文本的向下滑动效果这是我到目前为止的 jsfiddle如果您查看名为视频制作的标题 sample,则可以在此页面中看到我想要的结果。

目前只是向右滑动,我想要一个向下滑动的效果

最佳答案

把左边换成顶部?

body {
font-family: 'Open Sans', 'sans-serif';
color: #cecece;
background: #222;
overflow: hidden;
}

.item-1,
.item-2,
.item-3 {
position: absolute;
display: block;
top: 2em;
width: 60%;
font-size: 2em;
animation-duration: 20s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
}

.item-1 {
animation-name: anim-1;
}

.item-2 {
animation-name: anim-2;
}

.item-3 {
animation-name: anim-3;
}

@keyframes anim-1 {
0%,
8.3% {
top: -100%;
opacity: 0;
}
8.3%,
25% {
top: 25%;
opacity: 1;
}
33.33%,
100% {
top: 110%;
opacity: 0;
}
}

@keyframes anim-2 {
0%,
33.33% {
top: -100%;
opacity: 0;
}
41.63%,
58.29% {
top: 25%;
opacity: 1;
}
66.66%,
100% {
top: 110%;
opacity: 0;
}
}

@keyframes anim-3 {
0%,
66.66% {
top: -100%;
opacity: 0;
}
74.96%,
91.62% {
top: 25%;
opacity: 1;
}
100% {
top: 110%;
opacity: 0;
}
}
<p class="item-1">Fast.</p>

<p class="item-2">Slow</p>

<p class="item-3">Much slow</p>

关于html - 使用CSS的文本 slider ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57214756/

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