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 7922137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:51:00+00:00 2026-06-03T16:51:00+00:00

i am creating simple side menu, such that when the user hover on item

  • 0

i am creating simple side menu, such that when the user hover on item background color change and when he clicks on it the hover effect should be maintained until user clicks other item

my code:

 ul#nav {
    padding: 0;
    margin: 0 0 10px 0;
    -moz-appearance: menubar;
        -webkit-appearance: menubar;
    background-position: left;
    font-size: larger;
}

.mmenu{ width: 190px;
       position: fixed;
}
.mmenu a{
    font-size:14px;
    font-family: Arial, sans-serif;
    font-style: normal;
    font-weight:bold;
    display: block;
}

.mmenu a:hover{ color: white;
background-color: #003366;
font-style: oblique;
border-top: 0px outset #003366;
border-bottom: 0px inset #003366;
border-right:0px outset #003366;
border-left: 0px inset ;
}

the hover effect is working fine, however the style is not maintained when i click any item, i tried active, visited but no luck. anyone knows where is the problem?

html

<div id="nav" class="mmenu" style="border: 2px double #f2f2f2; left: 25px; width: 200px; border-radius: 6px;">
                            <ul type="none">        
                                        <li><a  href="another example.php">Messages</a></li>
                                        <li><a  href= "example.php">My Conferences</a></li>

                                    </ul>
                                </div>
  • 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-06-03T16:51:02+00:00Added an answer on June 3, 2026 at 4:51 pm

    Just add the attribute

    Onclick="this.style.background='#003366'"
    

    to the menu item (“.mmenu a”)

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

Sidebar

Related Questions

I'm creating a simple color picker controlled by a custom slider type control. I'm
I am creating a simple gradient background by drawing a quad as follows: glMatrixMode
I am creating a simple application with Django. I realized that I am doing
I'm creating a simple ajax call to retrieve a list of user reviews. I
I am creating a simple project that will allow me to upload and download
I'm creating a demo that must be in html code only (no server side
Background: I'm creating a very simple chatroom-like ASP.NET page with C# Code-Behind. The current
Coolio, i am working on creating a simple tree that sits as a archive
I am creating simple app on Silverlight 4. In folder of View I have
i am creating simple call filter application which restrict unwanted calls. i use following

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.