Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7048421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:53:24+00:00 2026-05-28T02:53:24+00:00

How do I change the background color of a <li> element after 3 seconds

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:53:25+00:00Added an answer on May 28, 2026 at 2:53 am

    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:

    <!DOCTYPE html>
    <html>
        <head>
        <style type="text/css"> 
            .square {
                width:100px;
                height:100px;
                background:red;
                position:relative;
                -moz-animation-name:colorChange;
                -moz-animation-duration:5s;
                -moz-animation-delay:5s;
                -moz-animation-iteration-count:1;
                -moz-animation-fill-mode:forwards;
            }
            @-moz-keyframes colorChange {
                from {background:red;}
                to {background:yellow;}        
            }
    
        </style>
        </head>
        <body>
            <div class="square"></div>
        </body>
    </html>
    

    JSFiddle sample: http://jsfiddle.net/c8DDP/

    Works from Firefox 4.0+ – the same can be accomplished using -webkit prefix for webkit based browsers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can I change the background color of current element using plain javascript? for
checkBox.setBackgroundColor(Color.RED); will change the background color of the whole element. I want only the
I'm trying to change background color of ImageView, but it updates only after I
i did't find any property of a tab container to change background color of
I want to change the background color of the page when one hovers over
I have an element on a page with background image set using css: //
I want to change the background color of an tr element, that contains a
I am trying to change the background color of a td element in a
I want to change the background color of li element to be changed when
I'm learning css and trying to change background-color of all html except one div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.