CSS Adjacent Sibling Combinator (+)
- Página anterior Combinador de descendientes
- Página siguiente Combinador de lista de selector
- Volver a la capa superior Manual de referencia de combinadores CSS
Definition and Usage
CSS Adjacent Sibling Combinator (+
) is used to select elements that immediately follow another specific element.
Example
Select and set the style of the <p> element that immediately follows the <div> element (not inside):
div + p { background-color: gold; border: 1px solid gray; }
CSS Syntax
element1 + element2 { css declarations; }
Technical Details
Version: | CSS2 |
---|
Browser Support
The numbers in the table indicate the first browser version that fully supports the combination.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Soporte | 7.0 | Soporte | Soporte | Soporte |
Páginas relacionadas
Tutorial de CSS:Selector de hermano adyacente de CSS
- Página anterior Combinador de descendientes
- Página siguiente Combinador de lista de selector
- Volver a la capa superior Manual de referencia de combinadores CSS