Showing text when a visitor rolls over a link or image on your website is a great way to share additional information about where a link leads or what an image contains. If you have access to edit the HTML code of your website, and know how to use link (A) and image (IMG) tags, you can easily incorporate rollover text.
-
Step 1
Find the HTML code for the image you want to add hover text for. It should look like this:
<img src=”http://www.linkto.com/your/image.jpg” />
-
Step 2
Add or edit the TITLE attribute containing the text you want to appear when someone rolls over the image.
For example:
<img src=”http://www.linkto.com/your/image.jpg” title=”Additional text to appear upon hover” />
-
Step 3
Add or edit the ALT attribute containing the text you want to appear when someone rolls over the image. (For cross-browser compatibility, your desired rollover text needs to appear in both the ALT and TITLE attributes.)
For example:
<img src=”http://www.linkto.com/your/image.jpg” alt=”Additional text to appear upon hover” title=”Additional text to appear upon hover” />
-
Step 4
Confirm your rollover is working by refreshing your Web page and holding your cursor over the image for one to two seconds.
-
Step 1
Find the HTML code for the link you want to add hover text for. It should look like this:
<a href=”http://www.yourlink.com”> Link Text</a>
-
Step 2
Add or edit the TITLE attribute containing the text you want to appear when someone rolls over the link.
For example:
<a href=”http://www.yourlink.com” title=”Additional text to appear upon hover”>Link Text</a>
-
Step 3
Confirm your rollover is working by refreshing your Web page and holding your cursor over the link for one to two seconds.
Show Text on an Image Rollover
Show Text on a Link Rollover
-
The methods used to show text on a rollover also make your website more accessible for people who are blind or have trouble seeing, because screen readers will speak the text out loud.