Image alt attribute best practices

后端 未结 10 1113
既然无缘
既然无缘 2020-12-20 16:51

What exactly is the intended use of the alt attribute on tags?

Should it describe the image, or should it provide meaningful re

10条回答
  •  春和景丽
    2020-12-20 17:05

    The HTML 5 spec has a huge section on this.

    Basically, the alt attribute should be what would be there as text if you hadn't used an image at all. If your image is purely decorative, you can use alt="". A description goes in the title attribute.

提交回复
热议问题