3. Styling an element which contains a specific processing instruction
Prev | Chapter 4. Other extensions | Next

## 3. Styling an element which contains a specific processing instruction

Use pseudo-class `:contains-processing-instruction(`target`, ..., `target`)` where `target`, a CSS identifier or string, is the target of the processing instructions.

Several processing instruction targets may be specified, in which case, the `:contains-processing-instruction()` test will pass if the subject of the test directly contains a processing instruction having any of the specified targets.

Example: display all XHTML `span`s containing one or more spreadsheet formulas with a yellow background.

    span:contains-processing-instruction(xxe-formula) {
        background-color: yellow;
    }

Prev | Up | Next
2. CSS3 selectors | Home | 4. Styling an element which contains a specific child element