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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:11:18+00:00 2026-05-23T08:11:18+00:00

I have an asp menu, with only 1 (top) level of menu items. Each

  • 0

I have an asp menu, with only 1 (top) level of menu items. Each of the menu items needs to have a different way to be recognized by CSS (for unique hover, etc.). I’m trying to avoid a javascript solution.

Currently I can find no way with just asp and CSS to control individual menu items. Any help would be appreciated!

<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false"
                    IncludeStyleBlock="false" Orientation="Horizontal">

    <Items>
        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="My Tab" />
        <asp:MenuItem NavigateUrl="foo.aspx" Text="etc" />
    </Items>
</asp:Menu>
  • 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-23T08:11:19+00:00Added an answer on May 23, 2026 at 8:11 am

    Lets say you have

    <ul class="menu">
    <li><a href="#foo1">First Item</a></li>
    <li><a href="#foo2">Second Item</a></li>
    <li><a href="#foo3">Third Item</a></li>
    <li><a href="#foo4">Fourth Item</a></li>
    <li><a href="#foo5">Fifth Item</a></li>
    </ul>
    

    If you want to use the attribute selector, you would do as

    ul.menu>li>a[href="foo1"]:hover
    {
    background-color: blue;
    }
    

    If you want to use the pseudo class, you would do as

    ul.menu>li:nth-child(1)>a:hover
    {
    background-color: blue;
    }
    

    If you want to use class or id just add the required class or ID to the li in the HTML and simply use

    ul.menu>li.class_name>a:hover /*class used*/
    {
    background-color: blue;
    }
    
    ul.menu>li.id_name>a:hover /*id used*/
    {
    background-color: blue;
    }
    

    You probally dont need the selector to be as specific as above and may omit the ul and others alike. It is just for an example. Please keep in mind that the pseudo class and attribute selector has varied support across browsers.

    • 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 with different items, with sub items, //ASCX FILE <asp:MenuItem
I have this asp:menu with a few items and want to be able to
I have asp.net Menu Item <asp:MenuItem NavigateUrl= Text=Download Value=Download/> . When this item gets
Ok I have an asp.net menu control which is created from codebehind. It works
using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In
I'm looking to create a top-level horizontal menu, with a second-level horizontal menu below
In our current Asp.net MVC application we have 2 menu systems one accross the
I have a ASP:Menü in vertical style. The MainItem is only 1 Button, deisgned
I have the following goal: I Have a list of top menu links on
I have a ASP.NET custom server control menu with the following jQuery in the

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.