How do I change the background color of a <li> element after 3 seconds the page is loaded without any javascript or JQuery? Only with CSS? I’ve seen people doing amazing things with CSS only and I think that this is also very possible.
This <li> is performing a horizontal menu and i would like to highlight this option for the 3 first seconds after the page is loaded.
No problem if the solution is css3 and HTML5.
This sample will do an animation on load that will change the background color of the square from red to yellow over with a transition of 5 seconds and will start 5 seconds after load – will execute only once and stay on yellow background:
JSFiddle sample: http://jsfiddle.net/c8DDP/
Works from Firefox 4.0+ – the same can be accomplished using
-webkitprefix for webkit based browsers.