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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:10:14+00:00 2026-05-15T18:10:14+00:00

For example: div > p.some_class { /* Some declarations */ } What exactly does

  • 0

For example:

div > p.some_class {
  /* Some declarations */
}

What exactly does the > sign mean?

  • 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-15T18:10:15+00:00Added an answer on May 15, 2026 at 6:10 pm

    > is the child combinator, sometimes mistakenly called the direct descendant combinator.1

    That means the selector div > p.some_class only matches paragraphs of .some_class that are nested directly inside a div, and not any paragraphs that are nested further within. This implies that every element matching div > p.some_class necessarily also matches div p.some_class, with the descendant combinator (space), so the two are understandably often confused.

    An illustration comparing the child combinator with the descendant combinator:

    div > p.some_class { 
        background: yellow;
    }
    
    div p.some_class { 
        color: red;
    }
    <div>
        <p class="some_class">Some text here</p>     <!-- [1] div > p.some_class, div p.some_class -->
        <blockquote>
            <p class="some_class">More text here</p> <!-- [2] div p.some_class -->
        </blockquote>
    </div>

    Which elements are matched by which selectors?

    1. Matched by both div > p.some_class and div p.some_class
      This p.some_class is located directly inside the div, hence a parent-child relationship is established between both elements. Since "child" is a type of "descendant", any child element is by definition also a descendant. Therefore, both rules are applied.

    2. Matched by only div p.some_class
      This p.some_class is contained by a blockquote within the div, rather than the div itself. Although this p.some_class is a descendant of the div, it’s not a child; it’s a grandchild. Therefore, only the rule with the descendant combinator in its selector is applied.


    1 Many people go further to call it "direct child" or "immediate child", but that’s completely unnecessary (and incredibly annoying to me), because a child element is immediate by definition anyway, so they mean the exact same thing. There’s no such thing as an "indirect child".

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

Sidebar

Related Questions

The following jQuery example should put some text into the div, but it doesn't.
<div class=example>Some example text</div> <div class=example>Some more example text</div> How can I remove all
<div id=example style=background:yellow;height:200px;width:200px;> <button>Some text</button> </div>​ I want #example to .hide when it's clicked,
I have multiple divs on the site! for example <div id='id_111232'>Some text</div> <div id='id_111233'>Some
I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div>
Can I get an element if its class contains some text? Example: <div class=headerbody></div>
<div class=example> <div class=test>Some text</div> <div class=whatever></div> </div> <div class=example> <div class=test>Some more text</div>
Well, lets see a markup as an example. <div class=_round_5>Some text</div> <div class=_brTop_5>Another Text</div>
what is the best way to get some html elements + values? example: <div
First of all; example of HTML code: <div classgrap1> some conetent</div> <div classgrap2> some

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.