My website features an <img />
element that initially lacks a src
attribute. The src
is added dynamically using JavaScript at a later point. While Chrome hides it, Firefox displays an empty space:
https://i.sstatic.net/3eZJ4.png
Is there a way to prevent this from happening using HTML attributes or CSS alone? I am considering appending the img
element after the image loads or changes using JS.
Is there an easier alternative to achieve this without using JS?