gpt4 book ai didi

css - 如何为文本输入编写 css 动画?

转载 作者:行者123 更新时间:2023-11-28 08:51:06 26 4
gpt4 key购买 nike

<sytle>
.typing{
display: inline-block;
width: 100%;
white-space:nowrap;
overflow:hidden;
-webkit-animation: type 2s steps(50, end) alternate;
animation: type 2s steps(50, end) alternate;
-webkit-animation-iteration-count: infinite; /* Chrome, Safari, Opera */
animation-iteration-count: infinite;
}
@keyframes type{
from { width: 0; }
}
@-webkit-keyframes type{
from { width: 0; }
}
<style>
<div id="top" class="header">
<div class="text-center">
<h1 class="typing" >
<b>Find anything for your Business Instantly</b>
<b>Source >> Supply >> Grow your Business Online</b>
<b>Create your Home &amp; Global website online</b>
</h1>
</div>
</div>

我在h1标​​签中有3个粗体标签,这里应该显示在一行中,作为一个接一个的粗体标签,如链接中所示see this link : http://www.indiamart.com/

谁能帮帮我。

最佳答案

原始代码 Lea Verou

@-webkit-keyframes typing {
from { width: 0 }
to { width:16.3em }
}

@-moz-keyframes typing {
from { width: 0 }
to { width:16.3em }
}

@-webkit-keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: black }
}

@-moz-keyframes blink-caret {
from, to { border-color: transparent }
50% { border-color: black }
}

body { font-family: Consolas, monospace; }

h1 {
font-size:150%;
width:16.3em;
white-space:nowrap;
overflow:hidden;
border-right: .1em solid black;

-webkit-animation: typing 17s steps(30, end), /* # of steps = # of characters */
blink-caret 1s step-end infinite;
-moz-animation: typing 17s steps(30, end), /* # of steps = # of characters */
blink-caret 1s step-end infinite;
}
<h1>This is a css typewriter</h1>

关于css - 如何为文本输入编写 css 动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36370041/

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