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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:48:20+00:00 2026-05-23T19:48:20+00:00

I like the hover effect to highlight rows in an unordered list. But when

  • 0

I like the hover effect to highlight rows in an unordered list. But when I have sublists, the result is a little much. The parent row surrounding the entire sublist is highlighted as well as the selected sublist item.

Is there a way to, using CSS, override the hover effect of the parent list item if the list item immediately contains an unordered list?

Fiddle: http://jsfiddle.net/LgCTm/

HTML;

<ul>
    <li>Row 1</li>
    <li>Row 2</li>
    <li>
        <ul>
            <li>Row 3 Col 1</li>
            <li>Row 3 Col 2</li>
        </ul>
    </li>
</ul>

CSS;

ul { padding: 5px 3px;
    margin: 3px 0; }
li { padding: 3px 2px; background-color: #DDD; }
li:hover { background-color: #0F0; }
  • 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-23T19:48:21+00:00Added an answer on May 23, 2026 at 7:48 pm

    This is a duplicate answer from 2 years back, this was the best answer back than:

    According to Wikipedia:

    Selectors are unable to ascend

    CSS offers no way to select a parent or ancestor of element that satisfies certain criteria. A more advanced selector scheme (such as XPath) would enable more sophisticated stylesheets. However, the major reasons for the CSS Working Group rejecting proposals for parent selectors are related to browser performance and incremental rendering issues.

    And for anyone searching SO in future, this might also be referred to as an ancestor selector.

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

Sidebar

Related Questions

If I have a chunk of code like this: .hover( function () { hoverState($(#navbar
Is there any jquery plugin that does google images like smooth hover effect? Any
I'm trying to create an effect where when you hover over a list item
I have a table which has rows that alternate colors, when I hover over
I'm currently using a hover effect using jQueryUI like this: $('#menu-header-menu li a').hover( function()
I need to rework a project that relied on hover effect, quite nice, but
Contextual Toolbar http://img14.imageshack.us/img14/9729/word2007toolbar.gif I'd like to have a toolbar similar to the hover toolbar
How can I get the same jQuery hover effect (easing) like that in the
I am looking for a jQuery plugin or tutorial to have a hover effect
I have the following code to provide a hover effect when I hover over

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.