5
I need that when an image does not have the attribute src
, css automatically recognizes this and hides that element with display:none
Which selector should I use to do this?
Example:
<img src="tem_imagem" class="image" />
<img class="image" />
But if there really is no src attribute, it will work?
– Wallace Maxters
Yes, it will. I’ll put it on the snippet.
– Diego Souza
I think in the case of "no src" it doesn’t work. If you put a class in this image by default and leave a border for example, it will be displayed. I think to make the right answer would be
.minha-imagem[src=""],.minha-imagem:not([src])
. It just worked that way here.– Wallace Maxters