I had tried a simple animation. See this fiddle.
HTML:
<div class="special_sec">
<span class="sub_heading">About Us</span>
<span class="sub_heading1">Services</span>
<span class="sub_heading2">Portfolio</span>
<span class="sub_heading3">Clients</span>
<span class="sub_heading4">Contact Us</span>
</div>
CSS:
.special_sec span {
font-size:30px;
list-style:none;
text-align:center;
padding:10px 0;
display:block;
animation:subheadinganimation 17s;
color: transparent;
}
In my CSS (.special_sec span
), I have added color: transparent
.
My problem is:
- If
color
is transparent, after the animation all the text are getting hidden. See my fiddle. - If I remove this
color
property, all the text are initially visible. Then the animation also runs. See this fiddle.
I want the text to be visible only after the delay timings that I have given. I can't understand the problem. What is the issue? How can I fix this?
You need to set the
animation-fill-mode
asforwards
so that the element would hold the state as at the final keyframe of the animation (which iscolor: #000
). Without this setting, the element reverts back to its original state (color: transparent
) after the animation is complete.