- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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>
Advertisements