Combinador de elementos hijos (>) de CSS
- Página anterior Combinador de elementos hijos
- Página siguiente Combinador de descendientes
- Volver a la capa superior Manual de combinador CSS
Definition and usage
CSS child element combinator (>
) is used to select elements that are direct children of a specific parent element.
The element matched by the second selector must be a direct child of the element matched by the first selector.
Note:Elements that are not direct children of the specified parent element will not be selected.
Example
Set the style for each <p> element that is a direct child of the <div> element by selecting and setting it:
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 compositor.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Soporte | 7.0 | Soporte | Soporte | Soporte |
Páginas relacionadas
Tutoriales de CSS:Selector de elementos hijos de CSS
- Página anterior Combinador de elementos hijos
- Página siguiente Combinador de descendientes
- Volver a la capa superior Manual de combinador CSS