开发者

Text equivalents for icons that using css background-image property

开发者 https://www.devze.com 2023-01-05 09:00 出处:网络
If the element is not rendered successfully, the text equivalent will be displayed. For开发者_如何转开发 the <img> tags, we could use ALT attributes to represent the text equivalents. But thing

If the element is not rendered successfully, the text equivalent will be displayed.

For开发者_如何转开发 the <img> tags, we could use ALT attributes to represent the text equivalents. But things get complicated when the image is rendered as <span> + background-image css property. Since ALT attribute is only meaningful for <img>, it couldn't be used here.

What should I do to create text equivalent for them?


You can use the title attribute.

See this and this for details.

<span title="my text" class="anImageClass"></span>
0

精彩评论

暂无评论...
验证码 换一张
取 消