Take the 2-minute tour ×

Netbeans, my IDE, marks this CSS as incorrect, but I can't tell the problem. I can't find anything that says contains-element is specific to CSS3, but the styling doesn't show up in Firefox or Opera.


span:contains-element(input[type="radio"]) {
    border:1px solid black;


<span><input type="radio" name="amount" value="Cash amount"/>Cash amount</span>
share|improve this question
Found it: xmlmind.com/xmleditor//_distrib/doc/csssupport/… It appears to be an XMLmind extension... –  Šime Vidas Aug 13 '11 at 1:09

1 Answer 1

up vote 5 down vote accepted

:contains-element isn't a CSS selector, as far as I know. Where did you get it from?

The fact that it doesn't exist explains why it doesn't work in browsers and Netbeans marks it as incorrect.

That looks like an attempted "parent selector" (maybe from some JavaScript library?) and as always, there is no parent selector in CSS:

As pointed out by @Šime Vidas, that selector is specific to this product:


This document describes the subset of CSS2 supported by XXE, as well as advanced "proprietary extensions" needed to style complex XML documents.


share|improve this answer
jQuery's :has() selector is one option if you need this in a browser. –  thirtydot Aug 13 '11 at 1:21
I didn't even notice that; thanks for pointing that out. –  Ricardo Altamirano Aug 13 '11 at 1:31
sizzle has similar selectors: saucelabs.com/downloads/documentation/… –  Jeremy Iglehart Jan 28 '12 at 19:09

Your Answer


