Selector for all a tag descendants

css, css-selectors

Solution

For all descendants, use:

#tab-banner *

For direct descendants, use:

#tab-banner > *

Edit:

As the op changed/clarified the question:

To find all descendants of a specific type, just use that type instead of `*`. Example:

#tab-banner a

So, what you are trying is correct. If the style doesn't apply to the elements that you expect, then those elements are actually not descendants of that section, or you have another rule that takes prescedence.

Problem

Sorry if this sounds pretty basic to those who follow the css tag. The webpage in question has multiple sections: ``` <section id="top"> ; <section id="tab-banner"> ``` Within these sections there is much html with many levels of nesting. I just want to say grab all `<a>` tags that are descendants of each section. E.g. ``` #tab-banner a { /* css here */ } ``` How do I say grab all elements of a certain type (a) that are descendents of elements with specific IDs?

Original source