CSS Next-sibling (+) Combinator
Example
Select and style the <p> element that are placed immediately after (not inside) <div> elements:
div + p
{
background-color: gold;
border: 1px solid gray;
}
Try it Yourself »
Definition and Usage
The CSS next-sibling combinator (+
) is used to select an element that is
placed immediately after another specific element.
Version: | CSS2 |
---|
Browser Support
The numbers in the table specifies the first browser version that fully supports the selector.
Combinator | |||||
---|---|---|---|---|---|
element1 + element2 | Yes | 7.0 | Yes | Yes | Yes |
CSS Syntax