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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:57:39+00:00 2026-05-26T15:57:39+00:00

I have got an simple html unordered list. <ul> <li>Item 1</li> <li> Group 1

  • 0

I have got an simple html unordered list.

<ul>
    <li>Item 1</li>
    <li>
        Group 1
        <ul>
            <li>Item 2</li>
            <li>Item 3</li>
        </ul>
    </li>
</ul>

I want to use CSS to make a simple effect when the mouse is over an Item or a Group.

li:hover
{
    background-color:#ff0000;
}

It works quite fine for “Group 1” or “Item 1” (not contained in a group) – When I’m moving the mouse over the color changes. But if I move over “Item 2” or “Item 3” “Group 1” also remains hightlighted (red background). In this case I only want to highlight “Item 2” or “Item 3”.

Has anyone an idea how to do this?

Thanks for your help!

===============================
EDIT

<ul>
    <li>Item 1</li>
    <li>
        Group 1
        <ul>
            <li>Item 2</li>
            <li>Group 2
                <ul>
                    <li>Item 3</li>
                    <li>Item 4</li>
                </ul>
            </li>
        </ul>
    </li>
</ul>

Mouse Over xxx should highlight yyy
xxx -> yyy
Item1 -> Item1
Group1 -> Group1, Item2, Group2, Item3, Item4
Item2 -> Item2
Group2 -> Group2, Item3, Item4
Item3 -> Item3
Item4 -> Item4

Please see http://image-upload.de/image/r76d79/1c7af56a19.png ,just a quick drawing.

  • 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-26T15:57:40+00:00Added an answer on May 26, 2026 at 3:57 pm

    Found probably the best solution at the jQuery documentation.
    http://api.jquery.com/event.stopPropagation/

    $('li').mouseover(function(e)
    {
        e.stopPropagation();
        $(this).addClass('hover');
    });
    
    $('li').mouseout(function()
    {
        $(this).removeClass('hover');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a simple HTMl form with one field as follows: <input type=text
I've got a simple CSS/HTMl question. I've got an image and some text in
I've got a simple website using plain HTML/CSS to display and PHP/MySQL for data
I have got a simple MySQL table and primary index (id) is not numbered
I have got the following very simple code: function init() { var articleTabs =
I have got a Wavecom Supreme GSM modem. I wrote a simple application that
I'm trying to build the simple layout that I have got in the image
I got a simple problem in SQLAlchemy. I have one model in a table,
I have a simple problem with XML got from database. Now, this XML can
Have got an NSString *str = @12345.6789 and want to find out if there

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.