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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:16:24+00:00 2026-05-18T11:16:24+00:00

i have two buttons in menu on mouse over the button change image to

  • 0

i have two buttons in menu on mouse over the button change image to another image but on mouse out it remains back to its original image what i want to do is to when i click this button it stat should be active so that one can know that which page he is visiting now.
my code is

#menu
{width: 628px;
height: 69px;
padding-left: 380px;
}
#menu ul {  list-style: none;}

#menu li {  display: inline;}
#menu a {   float: left;
    width: 107px;
    height: 28px;
        display: block;
    }
#menu a:hover { width: 107px;
        height: 28px;
}
#emailUs
  { display: block;
    width: 107px;
    height: 28px;
    background: url("../images/add_1.png") no-repeat 0 0;
}
#emailUs:hover
  {
    background: url("../images/add_h.jpg") no-repeat 0 0;
  }

and the html code is

#menu
{
width: 628px;
height: 69px;
padding-left: 380px;

}

#menu ul {
    list-style: none;
}

#menu li {

    display: inline;
}

#menu a {
    float: left;
    width: 107px;
    height: 28px;
        display: block;


}

#menu a:hover {
    width: 107px;
        height: 28px;



}

#emailUs
  {
    display: block;
    width: 107px;
    height: 28px;
    background: url("../images/add_1.png") no-repeat 0 0;

  }

  #emailUs:hover
  {
    background: url("../images/add_h.jpg") no-repeat 0 0;
  }

Note: my images are seperated images not a sprite image.

you can see the demo what i want to achieve (www.daniweb.com)

  • 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-18T11:16:24+00:00Added an answer on May 18, 2026 at 11:16 am

    Send a varible from program which page you are on. And add a class active or inactive and css the class

    for eg :

    <a href="home.php" class="selectedmenu">Home</a>
    <a href="myaccount.php" class="">My Account</a>
    

    Now give background-image for the class selected menu so only the home image will have the active background . If you are not using sprite then do like this

    <li id="home"><a href="home.php" class="selectedmenu">Home</a></li>
    <li id="myaccount"><a href="myaccount.php" class="">My Account</a></li>
    

    then call

    #home .selectedmenu{
    background-image:url('homeselected.png');
    }
    

    To send variable

    <?php
    $menuSelected ='home';
    ?>
    <a href="home.php" class="<?php if ($menuSelected=='home')echo ('selectedmenu');?>">Home</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a menu bar that is rotated slightly. Here are two buttons as
I have two buttons, one for start recording and another for stop recording. i
I have two buttons with the same ID: <button type=submit onclick=//do something id=theID>button 1</button>
I have two button's in the main menu. I invoking the camera when I
i have two questions Apple says there should not be any button or menu
I have a dropdown menu: <div class=buttons> <div class=dropdown> <a href=# class=button><span class=label>File</span><span class=toggle></span></a>
I have two buttons that moves a movieclip up/down the Y-axis. How do I
I have two buttons, which the user can click and will open a FileDiagloag
I have two buttons at the top of a jQuery validated form: one saves
I have two buttons in my layout say b1 and b2. By pressing b1

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.