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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:47:36+00:00 2026-05-15T02:47:36+00:00

html > body .home blog logged-in > div #wrapper > div #page > div

  • 0

html > body .home blog logged-in > div #wrapper > div #page > div .cats

I have a problem with selecting unordered lists (i.e ul > li.class-name class-name-number) at the above dom location in CSS. I am working with a wordpress theme.

Basically could I have suggestions for the correct selector to use in order to influence this tag? I can provide a simplified html structure if it will help.

I’ve tried a number of selectors along the lines of:

(sometimes)#page (# or .)cats (sometimes)ul li(sometimes with class name)

EDIT: I’ve tried the selectors suggested in the wordpress docs.

html structure:

<body class='*dynamic*'>
<div id="wrapper">
<div id="page">


<div id="header" role="banner">
        <h1><a href=""></a>Header</h1>
        <div class="description">Site info</div>
</div>

<div id="cats">
<ul>
<li class="page_item dynamically generated class"></li>
</ul>

<ul>
<li class="category_item dynamically generated class"></li>
</ul>
</div>

It is the two list structures I’m having problems with

div#cats ul {
    font-size:24px;
}

This is testing style. When it’s working, I’ll be changing it.

As requested

FURTHER:
I think this must be some sort of inheritance problem, so I’m going to attempt a slash and burn approach.

Thanks!

  • 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-15T02:47:37+00:00Added an answer on May 15, 2026 at 2:47 am

    If this is your selector, there are a few issues with it.

    html > body .home blog logged-in > div #wrapper > div #page > div .cats
    

    I’ll make a few assumptions. Since you didn’t provide actual code.

    I presume with the first part (html > body .home blog logged-in) you’re trying to match <body class="home blog logged-in">. The correct selector for matching exactly that would be: body.home.blog.logged-in, but in case you just want to match any of the classes, you need a selector for each of them. If they apply the same styling, you can have them as a comma separated list, like this:

    body.home, body.blog, body.logged-in { ... }
    

    The next part (body > div #wrapper) I assume you want to match <body><div id="wrapper">. The correct selector for that is body > div#wrapper. The current selector looks for <body><div><anytag id="wrapper">.

    The same applies for the rest of your selector. I’m assuming you simply have extraneous white space in there, which cause the selector to not match. For more information on CSS selectors, see documentation on W3.org, or if you’re looking for more basic stuff the W3Schools tutorial on CSS.

    Update after added HTML:

    There is no need to have such a specific selector. You can match the lists with the selector:

    /* Match both lists */
    div#cats ul {}
    
    /* Match first list */
    div#cats ul:first-child {}
    
    /* Match last list (CSS3) */
    div#cats ul:last-child {}
    
    /* Match items */
    div#cats li.page-item {}
    div#cats li.category-item {}
    /* NOTE! Underscores are not legal characters in classes and ids */
    
    /* Match generated class */
    div#cats li.dynamically-generated-class {}
    
    /* Match generated class filtered by two classes */
    div#cats li.page-item.dynamically-generated-class {}
    div#cats li.category-item.dynamically-generated-class {}
    

    If you have no need for matching .page-item and .category-item specifically in the div#cats only (e.g. they are not present elsewhere on the page), there is no need for prefixing the selector with div#cats.

    Update 2:

    The CSS selector you’ve posted is correct for the html you posted. (See my demo). Perhaps you have other rules which are affecting the result as well. Try adding a border to the rule, to see if it really is matching the correct element.

    Firebug is a very useful debugging tool for Firefox, which let’s you see all the css rules which are being applied to a element. Perhaps that can help you?

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

Sidebar

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.