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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:18:54+00:00 2026-06-12T03:18:54+00:00

Say I have a <div id=container> with various elements inside of it including tables.

  • 0

Say I have a <div id="container"> with various elements inside of it including tables. Does the CSS selector #container table select all tables within the div (including grandchildren, great-grandchildren, etc)? Or does it select children only?

Also, if I want to select the first child div within the container div, how would I do that?

  • 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-12T03:18:56+00:00Added an answer on June 12, 2026 at 3:18 am

    Yes; to put it simply, that selects all table elements within #container, regardless of nesting level.

    The space is called the descendant combinator. As exactly what it says on the tin, it selects any descendants. That includes children, grandchildren, etc, again regardless of nesting level. It does not only select children; that purpose is served by the child combinator >.1

    To select the first child within your container as a div, you use

    #container > div:first-child
    

    Or if you have something else as the first child and you want to pick the first child that is of type div, you use

    #container > div:first-of-type
    

    1 For this purpose, it’s often said to select only “direct children”, and where people say “children” they often mean “descendants” instead. Strictly speaking, though, “children” refers to immediate nesting level. 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

Say I have a container with various elements inside. In turn, any element could
Lets say I have a div #elements with a ul inside.The div has position:
I have a div container inside which there are several child divs with css
I have a div (let's say the id is container) with many elements in
Lets say I have a container div, inside of which are div containers of
Say you have the zen snippet: div#container>(div.panel>h2{this is the header inside panel $})*3 it
Say you have the following CSS applied to a div tag .divtagABS { position:
Say I have a select box eg <div data-bind='visible: someProp'> <select class=selectSubWidgets data-bind='options: subWidgets,optionsText:
Let's say I have this: <div id=wrapper> <pre class=highlight> $(function(){ // hide all links
Say I have this: <div class='container'> <img src='image1' id='1' /> <img src='image2' id='2' />

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.