Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS element+element selector

CSS element+element Selector

Complete CSS SelectorComplete CSS Selector Reference Manual

Example

Select all elements immediately following

elements immediately following the first

element:

div

p

{

background-color:

yellow

;

}

Try it »


Definition and Usage

element+element The selector is used to select the element that immediately follows a specified element (not one inside it).


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support element+element selector.

Note: element+elementTo work in IE8, a DOCTYPE must be declared


Complete CSS SelectorComplete CSS Selector Reference Manual