Why An HTML Image Alt Text Doesn't Show On Hover - Computer Hope
Có thể bạn quan tâm
- Home
- Help
- HTML Help
- HTML Q&A
Unlike the Microsoft Internet Explorer browser, Mozilla Firefox, Google Chrome, and other browsers do not display the text used in the alt attribute when hovering over an image. The alt text is designed to display when an image doesn't load, whereas the title text is designed to display balloon text for images that do. Firefox, Chrome, and other browsers (except Internet Explorer) follow the W3C standards for HTML (HyperText Markup Language), which states that an image should have title attribute for balloon text. For that reason, these browsers do not display the alt text on hovering over the image.
If you want balloon text to appear when the mouse hovers over an image, add "title" to the img HTML tag as shown in the example code below.
Image with only an alt attribute. (Does not show balloon text.)
<img alt="Example of alt text" src="https://www.computerhope.com/cdn/media/logo-200.png">Image with both alt and title attributes. (Shows balloon text with mouse hover.)
<img alt="Example of alt text" title="Example of title text" src="https://www.computerhope.com/cdn/media/logo-200.png">If you are using Mozilla Firefox or Google Chrome, the first example displays no balloon text with only an alt attribute in the code. However, adding the title attribute, as seen in the second example, displays balloon text when the mouse hovers over the image.
Related information
- HTML <img> tag information and help
- How to create a text description for an image in HTML.
- Computer Hope media library
- HTML and web design help and support.
- Was this page useful?YesNo
- Feedback
- Share
Từ khóa » Html Button Alt Text On Hover
-
Tooltips For Button Elements - Html - Stack Overflow
-
HTML Input Alt Attribute - W3Schools
-
Tooltips - Bootstrap
-
The HTML Alt And Title Attributes
-
Image ALT Tag Tips For HTML - Accessibility At Penn State
-
Remove The Text On Icon Hover (title Tag)
-
How To View The Alt Text When Hover Over An Image
-
Alt Text Doesn't Appear On Hover - Finalsite Support
-
Adding Alt-tags To Links - 'How To' Guides - Web Editors' Handbook
-
Mouse Hover Message On Input Type Button Like Alt In Image Button
-
Creating Mouseover Text With HTML - Knowledgebase - Google Sites
-
Image Alt Text Vs Image Title In WordPress - What's The Difference?
-
Rt
-
- HTML: HyperText Markup Language | MDN"> - HTML: HyperText Markup Language | MDN