开发者

CSS Children applying a style to a parent

开发者 https://www.devze.com 2023-02-10 01:23 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消