i have been searching around stackoverflow for an answer for a while but it seems to me this isn't been questioned before.
excuses if i might have missed the answer somewhere but here it goes:
So i am working on a page that fades in a div on page load, now i want to fade it out after a few seconds. i can't seem to find the right way to get this done.
@-webkit-keyframes fadein {
from {
opacity:0;
}
to {
opacity:1;
}
}
@-webkit-keyframes fadeout {
from {
opacity:1;
}
to {
opacity:0;
}
}
div {
width: 400px;
margin: 0 auto;
text-align: center;
-webkit-animation:fadein 1s;
-webkit-animation:fadeout 1s;
-webkit-animation-delay:fadeout 5s;
}
The html:
<div>
<h1><font size=+6> :(</font></h1><br />
<h1>Whoops<span>Something went wrong</span></h1><br />
<h1><span><div id=timer_div>you will be redirected in</div> seconds</span></h1>
</div>