Forum Moderators: not2easy
This is probably a long shot, but is there a way in css to get an image to display the alt or title text instead of the image?
My code is something like this:
<div class="mydiv">
<a href="http://somelink.com">
<img src="myimg.jpg" alt="my image" />
</a>
</div> In the text only version it would be ideal if it could spit out the alt or title tag or something, in place of the image.
Any thoughts?
[edited by: HelenDev at 12:10 pm (utc) on Aug. 23, 2006]
<img class="alt_img" src="image.jpg" alt="alternative text here" />
<div class="alt_text">
Alternative text here
</div>
The CSS for the regular website would be:
div.alt_text {
display:none;
}
Then the CSS for the text-only (or printable) page would be:
div.alt_image {
display:none;
}
Then, depending upon which stylesheet is called, either the image disappears, or the text does.
Don't know how much that helps, but that's how I've always done it! I haven't found any other ways to accomplish it - but I'll watch in case someome else comes along with a better idea :)