How can apply a css style just to PNG images?
.pngImages {opacity:0.75}
.pngImages:hover {opacity:1}
I have many pages that contain repeated PNG files.
How can apply this class to all of them without specify img class="pngImage"
...
A thing like this but just for png images:
div {background-color:#ddd}
You can use the attribute selector
img[src$=".png"]
This selects all png images
Assuming you only need to take care of <img>
tags, and not background-images as well:
img[src$='.png'] {
background-color: #ddd;
}
This selects all image tags which have an src attribute value ending in .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