I'd like to use CSS Attribute Selector to apply a class to some spans, but only if they have content. I have a custom attribute that will only have a value if the span has content: "entityvalue". When using the CSS below, it does not apply the class to any elements, even if entityvalue='1634'
is in the HTML.
.ApplicationName[entityvalue="*"] {
display: inline;
background-image: url("../images/icon_application.PNG");
background-repeat: no-repeat;
background-position: left;
padding-left: 12px;
}
I tried .ApplicationName[entityvalue!=""]
as found on some sites but apparently it's not in the CSS standards (doesn't work in Chrome) which really sucks, because .ApplicationName[entityvalue=""]
does exactly the opposite of what I need...
Here are examples of a span/div WITH content (that should be styled) and a span/div WITHOUT content (which should NOT be styled):
<div class="ApplicationName Redirect" entitytype="Application" entityvalue=""></div>
<div class="ApplicationName Redirect" entitytype="Application" entityvalue="1234">Microsoft Outlook</div>