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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:49:36+00:00 2026-06-18T08:49:36+00:00

This selector isn’t working like I might expect: <style type=text/css> .someClass p, b {

  • 0

This selector isn’t working like I might expect:

<style type="text/css">
    .someClass p, b {
        color:red;
        cursor : pointer;
    } 
</style>
<p>This is a test</p>
<p>This is another <b>test</b></p>
<p class="someClass">This is a test with someClass</p>
<p>This is another <b class="someClass">test</b></p>

Results and jsFiddle:
Text for the non-styled paragraphs and styles appear black.
Text for the p with class “someClass” is not appearing with red text, however the b with class “someClass” does appear red.

Problem:
Why does the p class=”someClass” (third paragraph) not appear in red, while the b class=”someClass” (fourth paragraph) appears in red?

Both tags are included in the someClass selector. I’ve not had much luck in finding an answer with searching, and the documentation doesn’t appear to address this exact scenario

  • 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-18T08:49:36+00:00Added an answer on June 18, 2026 at 8:49 am

    If you want your style to apply to paragraphs and b elements with class someClass, use

    p.someClass, b.someClass {
        color: red;
        cursor: pointer;
    }
    

    Your existing selector targets

    • any b element
    • paragraphs that are inside an element having the class someClass.

    This code :

    .someClass p, b { something }
    

    is the same as

    .someClass p { something }
    b { something }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw this selector in Twitter Bootstrap: .show-grid [class*=span] { background-color: #eee; text-align: center;
Css "hover" selector applys a temporary style to an element, but it isn't definitive:
I can't get my head round why this first-child selector isn't working. I've created
This CSS selector picks up elements without a class attribute: a:not([class]) This CSS selector
I want to parse this CSS Selector (and others of a similar form): div.class1#myid.class2[key=value]
Given this HTML: <div class=OpenIDSelector>some text</div> Why does this JQuery selector match it on
I'm creating a new thread like this: [NSThread detachNewThreadSelector: @selector(myMethod:) toTarget:self withObject:filePath]; and in
I'm having difficulty understanding why a particular selector isn't working for me. Admittedly I'm
I am not sure why my child selector isn't working properly. In my example,
In jQuery UI, widgets are created like this: $(#selector).accordion({ //options }); How would 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.