View Full Version : Appending an image to a CSS class
11-27-2006, 09:33 AM
<a href="page1.htm" class="asterisk">Page 1</a>
Page 1 *
This would be particularly useful for an image to show that the link opened in a new window. Any help very gratefully accepted.
11-27-2006, 11:46 AM
CSS 2 supports generated content, which is exactly what you need. Alas it's only supported in Firefox, not even IE7: CSS Generated Content (http://www.dynamicdrive.com/style/csslibrary/item/css-generated-content/)
11-27-2006, 12:33 PM
You could add an image as a background in the CSS for the class and use padding to keep the text from sitting on top of it, something like:
background: url(myImage.gif) no-repeat;
Change the 10px to whatever is needed to keep the text from on top the image. You can also use the background position property to adjust the placement of the image if needed.
11-27-2006, 01:19 PM
CSS 2 supports generated content, which is exactly what you need. Alas it's only supported in Firefox ...
And Opera, and probably a few others, too. But yes, MSIE spoils the fun somewhat. Generated content shouldn't be used for important data anyway, so its absence shouldn't matter.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.