WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: alt text and captions

for

From: julian.rickards@ndm.gov.on.ca
Date: Feb 9, 2004 8:18AM


In advanced browsers that support CSS generated content, this type of code
may eliminate the need for both alt and caption text.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
img:after {
content: attr(alt);}
-->
</style>

</head>
<body>
<img src="scenic.jpg" alt="This is a scenic photograph" width="406"
height="273">
</body>
</html>

I can't show you the results. It is my understanding that only Opera 7+ and
Safari supports this. For those who can't see the results, the content:
attr(alt); displays the content of the alt attribute as text right beside
the image and with additional styling, fonts, colors, alignment and other
properties may be applied. I have also seen content from the <title> tag
displayed within the browser window but I can't remember the details of how
it was done - something very similar but it pulled the content from the tag,
not just an attribute.

Idea came from: http://www.literarymoose.info/=/synopsis/violate.xhtml, near
the bottom are Floated Generated Content and Positioned Generated Content.

---------------------------------------------------------
Julian Rickards
Digital Publications Distribution Coordinator
Publications Services Section
Ontario Ministry of Northern Development and Mines
Phone: (705) 670-5608
Fax: (705) 670-5690


----
To subscribe, unsubscribe, suspend, or view list archives,
visit http://www.webaim.org/discussion/