I have element that I want to hide if the background-color
property has specific url provided to it (namely default image - copied from HTML that I have no control over : style='background-image: url("assets/images/default_logo.png");'
)
Is there a way to query for this specific case with CSS?
Concrete example:
<div class="module-logo"
ng-show="!show_loading && module_logo != ''"
style="background-image: url("assets/images/default_logo.png");"
aria-hidden="false">
</div>
Yes, you can select that div with this:
div[style^="background-image: url"]
It might require you to use CSS escape characters, which can get messy, so you can alternatively use two sets of selectors to check for the substrings that target exactly what you're looking for. Example of something that would work here:
div[style*="background-image: url("][style*="default_logo.png"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With