Is there an image file format selector in CSS?

I want to use the display:none property on all .gif images (displayed using <img> tags) on my website. Is there a CSS selector that can do this? Or is jQuery the best way to do this?

This does not work, but I am looking for something like this:

 img[gif] { display:none; } 

I know this is a simple question; Google did not give any results.

+6
source share
1 answer

You can do:

 img[src$=".gif"] { display: none; } 

This appears at the end of the src attribute for ".gif" for all <img> elements.

+10
source

Source: https://habr.com/ru/post/954124/


All Articles