Re: Selecting the parent of an element

On Fri, 07 Oct 2011 15:21:52 +0200, Brian Kardell <bkardell@gmail.com>  
wrote:

> form =.form-row input:focus { outline: solid 1px #ccc; }
>
> Couldn't you write that as:
>
> form:matches(form .form-row input:focus) { outline: solid 1px #ccc; }

No, as far as I know that selector doesn't match anything; it selects  
elements that match both the selector "form" and the selector "form  
.form-row input:focus" (i.e. any element of type "form" that also has type  
"input" and is focused and has a .form-row ancestor that in turn has a  
form ancestor).

(The point of :matches is to be able to write e.g. "A > B:matches(.foo,  
.bar) > C" instead of "A > B.foo > C, A > B.bar > C")

-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA

Received on Friday, 7 October 2011 14:02:11 UTC