CSS element>element Selector

Complete CSS Reference Complete CSS Reference

Example

How to style all <p> elements who's parent is a <div> element:

div>p
{
background-color:yellow;
}

Try it yourself »

Definition and Usage

The element>element selector styles elements with the specified parent.

Note: Elements that are not directly a child of the specified parent, are not styled.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The element>element selector is supported in all major browsers.

Note: For element>element to work in IE, a <!DOCTYPE> must be declared.


CSS Version

The element>element selector was first introduced in:

CSS 2


Complete CSS Reference Complete CSS Reference