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

  • Home
  • SEARCH
  • 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 9061111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:24:12+00:00 2026-06-16T15:24:12+00:00

I wonder if you could help out with the code below, I understand that

  • 0

I wonder if you could help out with the code below, I understand that color styles are inherited but for some reason im not getting the expected results. For example looking at the list beginning with ‘category 5’ this appears blue where the subcategories e-f appear green. I have set the style as ‘new_list’ which should be blue is correct but this is not inheriting down the list to the other ul items in subcategory E-H.
Cheers

<style>
.new_list   {color:blue;}

.all_list   {color:red;}

ul      {color:green;}
</style>



<ul class='all_list'>
    <li>Category1
        <ul class='sub_list'>
            <li>SubCategoryA</li>
            <li>SubCategoryB</li>
            <li>SubCategoryC</li>
            <li>SubCategoryD</li>
        </ul>
    </li>
    <li>Category2</li>
    <li>Category3</li>
    <li>Category4</li>

</ul>




<ul class='new_list'>
    <li>Category5
        <ul>
            <li>SubCategoryE</li>
            <li>SubCategoryF</li>
            <li>SubCategoryG</li>
            <li>SubCategoryH</li>
        </ul>
    </li>
    <li>Category6</li>
    <li>Category7</li>
    <li>Category8</li>

</ul>
  • 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-16T15:24:14+00:00Added an answer on June 16, 2026 at 3:24 pm

    you have contradicting rules applying to the same element:

    you define ul:green and .new_list:blue. in the case of the main UL with class of .new_list the class rule takes precedence over the element rule since it is more specific. This is not the case when it comes to the child UL which doesn’t have a .new_list class and therefore the general ul:green definition takes precedence over the default inherited color and being itself passed by inheritance to the LI children.

    In other words: Inheritance is an implicit default which is overridden by any explicit rule

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

Sidebar

Related Questions

Hi wonder if anyone could help me. the first code below basically counted every
wonder if you could help me out with some Javascript. I have a string
I wonder if someone could help me figure out how to parse a string
I wonder if anyone can help me to understand where I could be going
I wonder whether someone could possibly help me please. So that I can maintain
I wonder if any of you could help with this problem. The following code
I wonder whether someone could help me please. I'm using the script below to
wonder if someone could help me with a little problem. I have session values
I wonder if you could help me with something I've been thinking about. Say
I wonder if anyone could help me with a problem I've been having. I

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.