HTML img alt Picture alternative text
The function of the HTML img alt attribute is to create image alternative text . This image alternative text is quite similar to img title , but the difference is that img alt is used when the image is wrong or invalid (for example, the image is removed or the server permission is modified) , Let the browser display the alternative text, but when the mouse is moved to the picture, the alternative text will not be displayed, which is equivalent to the filing of the picture. If the picture in the article is invalid, the web designer may not want an x , If the img alt attribute is set, readable text can be displayed.
HTML img alt syntax example
Although the img alt is only effective when the image is invalid, the alt attribute is used in the IE browser. When the mouse mentions the image, the alternative text will still be displayed. Other common browsers such as Google Chrome and FireFox , Opera These will not be displayed. In addition, some versions of Google Chrome cannot display the alternate text effect of img alt.
The alternative text of HTML img alt can be written in Traditional Chinese, which is usually used to indicate the content of the image or the link of the image. For example, when the HTML <a> tag is used for the image, it is recommended not to put too much meaningless in the alt tag To mislead the reader.
Post a Comment
0 Comments