如果图片不存在,默认会显示一个缺失图片,这是不友好的 
所以可以加上alt属性。 
当图片存在的时候,alt是不会显示的 
当图片不存在的时候,alt就会出现

<img src="http://how2j.cn/example_not_exist.gif" />

<br/>

<img src="http://how2j.cn/example.gif" alt="这个是一个图片" />

<br/>
<img src="http://how2j.cn/example_not_exist.gif" alt="这个是一个图片" />

 

效果:

 

Image中的alt
Image中的alt
Image中的alt

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-11-02
猜你喜欢
  • 2021-12-12
  • 2021-12-12
  • 2022-12-23
  • 2021-12-08
  • 2022-01-20
  • 2021-05-26
  • 2021-10-01
相关资源
相似解决方案