CSS Children applying a style to a parent
Given something like this:
.threadTitle {
}
.threadTitle.jeditable input {
}
When jeditable (jquery plugin) is active, the input appears, when it is not, the INPUT is not on the page. What I want to do is apply a style to .threadTitle only when the input is on the page?
Something like, .threadTitle When Input (.threadTitle.jeditable input) is visible {...}
Is this p开发者_如何学编程ossible with CSS?
.threadTitle:has(input)
will match an element with .threadTitle
class if and only if it contains an input element. Not all browsers support it though.
It is called :contains
(I must have mixed it up with the jQuery :has
selector); more importantly, it has apparently been removed from the CSS3 draft a while ago.
精彩评论