` elements that are inserted within `
` elements:
## Example
```css
div p {
background-color: yellow;
}
[Try it yourself Β»](#)
* * *
## Child Selector
Compared to the descendant selector, the child selector can only select elements that are direct/first-level children of a specific element.
The following example selects all direct child `
` elements of `
` elements:
## Example
```css
div > p {
background-color: yellow;
}
[Try it yourself Β»](#)
* * *
## Adjacent Sibling Selector
The adjacent sibling selector selects an element that is immediately preceded by another element, and both share the same parent element.
If you need to select an element that is immediately after another element, and both have the same parent, you can use the adjacent sibling selector.
The following example selects the first `
` element that is immediately after a `
` element:
## Example
```css
div + p {
background-color: yellow;
}
[Try it yourself Β»](#)
* * *
## General Sibling Selector
The general sibling selector selects all sibling elements that follow a specified element.
The following example selects all `
` elements that are siblings following a `
` element:
## Example
```css
div ~ p {
background-color: yellow;
}
[Try it yourself Β»](#)
YouTip