CSS fade in delay then fade out

Associate
Joined
20 Apr 2004
Posts
1,745
Location
London
Hey guys,

Maybe im totally stupid but this doesn't seem as easy as it sounds... All I want to do is fade in a logo and 30 sec later fade out.

I have a logo as a div. <div=class "logo"></div>. Etc

Then the animation properties. Everything fades in fine.

#logo {

Animation name: fadeout 1s {
Etc

}

Then the

Keyframes fadeout{

0% {
Opacity 1;
}

100% {
Opacity 0;

}

But! It wont. I'm trying to ad another delay but it doesn't work.

I'll paste the proper code when I get home. I tried using jquery but apparently this clashes with CSS animations?

Cheers!
 
Soldato
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
Associate
OP
Joined
20 Apr 2004
Posts
1,745
Location
London
Not quite. That loops indefinitely. I need the logo to come on screen, then hold for x amount of seconds, then fade out. Just how you might see on a TV ad.
 
Soldato
Joined
3 Sep 2012
Posts
11,376
Location
P town
animation-name: fadein 2s 30s, fadeout 2s

Don't forget to make the keyframes for fadein.

And yeah it should be .logo as it's a class, # is for IDs.
 
Back
Top Bottom