Home Forums General XMetaL Discussion CSS to colour a parent element based on content of attribute on a child element Reply To: CSS to colour a parent element based on content of attribute on a child element

Su-Laine Yeo

Reply to: CSS to colour a parent element based on content of attribute on a child element

I don't know of a way to achieve exactly what you're looking for, however if you need to signal that the child element has an empty attribute, you could do this by using before-text to make the child element visible and styled. For example:

child[status=””]:before
{
    display: inline;
    content: “No status specified”;
    color: red;
}

Would this work for you?

Reply

Products
Downloads
Support