
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to include an alternate text when the original element fails to display in HTML?
Use the alt attribute to add alternative text for an image. If the user fails to view it (loading issue), then the same text will be visible. In addition, the attribute helps screen readers in reading the content to the user.
Example
You can try to run the following code to implement alt attribute in HTML −
<!DOCTYPE html> <html> <head> <title>HTML alt attribute</title> </head> <body> <p>Simple Image Insert</p> <img src = “https://www.tutorialspoint.com/videotutorials/images/tutorial_library_home.jpg” alt = "Tutorials Library" /> </body> </html>
- Related Articles
- How do we include the direction of text display in HTML?
- How do we include an emphasized text in HTML?
- How to include an acronym in HTML?
- How to include an abbreviation in HTML?
- How to display the background color of an element in HTML?
- How to display deleted text in HTML?
- How to change the text color of an element in HTML?
- Include keyboard text in HTML
- How to include an input field in HTML?
- How to include another HTML file in an HTML file?
- How do we include big text in HTML?
- How to display text Right-to-Left Using HTML?
- How to display HTML element with JavaScript?
- How to include an external JavaScript inside an HTML page?
- How to set style display of an html element in a selenium test?

Advertisements