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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:51:42+00:00 2026-06-02T20:51:42+00:00

My question: How to create an on hover effect with for my ASP.net menu.

  • 0

My question: How to create an on hover effect with for my ASP.net menu.
The problem is that since the standard ASP.net menu doesnt have an on hover function, its quite hard/impossible(?) to create.

After doing my homework i saw some people who tried it with css, jquery and other methods… but i would prefer ‘normal’ html or css without incredibly complicated solutions.
Should that really be impossible, is there any clear way how to use it?

Most of the css options failed, or were incredibly complicated.

What exactly should happen:
A menu item for example

<asp:MenuItem NavigateUrl="~/Pages/Test.aspx" Text="Test" Value="Test" Selectable="true"></asp:MenuItem>

Should get a different background because of on hover effect.

Maybe changing the CSS from within the C# code into something else?

Thanks for your answer!

~Solved~
Thank you very much for your help! The problem is solved thanks to both of the answers.
I tried inplementing that menu, when i noticed that in this menu the hover effect also didnt work. What was the problem? I use 2 css files. And because the first css file contained some instruction as to how to handle the a:hover, all of the other hover effects were ignored.

Now that i know why the hover effect wasnt working, i can solve this problem. Thank you both very much!

  • 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-02T20:51:43+00:00Added an answer on June 2, 2026 at 8:51 pm

    Alright guys, it took me quite some time to figure out how to create the on hover effect with the ASP.net menu. So, i found an easy way, without all the hard stuff or lots of code.

    If you look at your asp page in your browser, go to page source. When you look at your menu, you will notice that it looks like this:

    <li>
        <a class="level1" href="Home.aspx">
        <img src="../Images/home.png" alt="" title="" class="icon" />Home</a></li>
    <li>
        <a class="level1" href="Page2.aspx">
        <img src="../Images/homehover.png" alt="" title="" class="icon" />Page2</a><ul class="level2">
    

    The solution would be to change your css:

    a:hover[href*="Home"][class*="level1"]
    {
         color: black;
    }
    

    This piece of CSS selects the A element, where (in the HTML) the attributes href and class contain(or are equal to) Home and level1.

    It might be a bit different if you have a more complex menu then i do, for i have just 2 levels deep. (menu and submenu)
    Hope it helps you guys!

    Then this is the end of my first question/answer on stackoverflow.
    Thanks for your help!

    ps: If it doesnt work, remove all a:hover statements in all related css files to the page with the menu. It might also be a problem if you use the StaticHoverStyle/DynamicHoverStyle.

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

Sidebar

Related Questions

I have to create the effect of bordered when I hover over element and
this might be a stupid question, but I'm using asp.net list control that creates
I have a question concerning functions with jQuery. I have a function that once
i got a question when create a javascript object, when one function invoking another
Question How do you procedurally create a function in Python which takes specific named
The fundamental question is how do I create a unit test that needs to
how to create own function and call it another function? like- $('.mycls li').hover(function() {
I am trying to create a rollover effect with jQUery. I have similar things,
I have a question... I want to create a class called thumb w/ all
I'm using jQuery to create a simple, but large dropdown menu. I have some

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.