Specifying Text to Display for Nongraphical Browsers - HTML

As mentioned repeatedly in this book, it is important not to get caught up in the graphical nature of the Web, forgetting that not all user agents support graphics. In addition, some users turn off images in their browser to speed up browsing. You can use the alt attribute of the <img> tag to specify text that should be displayed when the image cannot. For example, consider the following text and the display in Figure :

<p><img alt=“Picture of a cat” src=“cat.jpg” style=“float: right” width=“70px”> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>

The alt attribute specifies text to use when the image cannot be displayed.

The alt attribute specifies text to use when the image cannot be displayed

Some user agents display the alt attribute text when the user mouses over the image. This allows you to use the alt attribute to include additional information about an image. If you have a lot of information to convey, consider using the longdesc (long description) attribute as well. The longdesc attribute specifies a URL to a document that is to be used as the long description for the figure. Note that it is up to the user agent to decide how to enable access to the long description, if at all.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

HTML Topics