Null problem of HTML img

Let the boss take a look. What I want to ask is, can I set the default style of the damaged image when img is empty?

Feb.28,2021

img can have onerror events
vue

<img src="a.gif" onerror='this.src="default.gif" />
$('img').error(function(){
    $(this).attr('src',"default.gif");
})

if you have to use the img tag, the onerror event will trigger the onerror event if an error occurs during the loading of the image. You can use a transparent picture to display it, and then your background can overwrite

.

Why don't you consider using background for all other tags



<img src="" alt="" style="height: 100px;width: 100px; display: inline-block;">

got the answer. Thank you

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be3cdf-31692.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be3cdf-31692.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?