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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:14:43+00:00 2026-05-30T20:14:43+00:00

I am not sure why my child selector isn’t working properly. In my example,

  • 0

I am not sure why my child selector isn’t working properly. In my example, only the direct <li> tag should have the red color. But instead, all <li> tags are colored red.

This is the jQuery fiddle of my problem:

http://jsfiddle.net/5Jf4Y/2/

  • 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-30T20:14:44+00:00Added an answer on May 30, 2026 at 8:14 pm

    My guess is that both your selectors have the same specificity + the color property is inherited.

    The color property is inherited.

    Set first the default color for <li> elements and apply a different color for the direct children .courses > ul > li:

    .courses ul li { 
        color: Black;
        margin-left: 40px; 
    }​
    
    .courses > ul > li { 
        color: #9E002E; 
        font-size: 20px; 
    }
    

    DEMO

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

Sidebar

Related Questions

Not sure if I am using the correct term, but it's not child/parent since
Not sure what's going on here. I have a DateTime object, and when I
not sure what i'm missing, but here ti go's: i have a floating left
I'm not sure how best to phrase the question, but essentially I have a
I'm trying to set up my jQuery selector but I'm not exactly sure how
not sure if this is programming enough or if it should go to superuser,
sorry for the title but I'm not sure how I should call it. I'm
I am working on a linux server programming and I am not sure the
Not sure how to title this... So I've got three child classes of Event
Not sure I'm asking the right question, but it's a start. I have a

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.