How does css modify the small icon that failed to load the picture?

In the

page, if the picture fails to load, a very ugly small icon will be displayed. How to hide or modify this icon?

Css
Mar.07,2021

pseudo objects : before and : after are not displayed when the picture is displayed normally. However, it will be displayed when there is an error in the loading of the picture.


img {
  display: block;
  position: relative;
}
img:after {
  content: ' ';
  display: block;
  position: absolute;
  width: 20px;
  height: 20px;
  background: -sharpeee;
}

image loading error, there seems to be no pseudo class such as the link has been clicked.
the image loading error is not detected with css, so it can only be implemented with js.

Menu