How to stop broken images showing

后端 未结 12 2380
谎友^
谎友^ 2021-01-02 12:08

I have a table with some images that I want to start out with no images in them.I have set the src=\"\".But when viewed in a browser it shows broken image pics.



        
12条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 12:37

    Don't use images that point to nothing.

    You could style them to have no visibility (will not work if you have anything in the src attribute, even if it is a bad URL):

    img[src=''] 
    {
      display: none;
    }
    

    But as I already said, if you don't have an image do display, don't put the tag on the page.

提交回复
热议问题