CSS Library: Other: Here
CSS Generated Content
Author: Dynamic Drive
CSS2 supports the insertion of generated content, which is content that's specified using your style sheet and applied dynamically to the page according to your CSS definition. This is very useful for further decorating an element with rich content that should not be part of the page's actual markup. CSS Generated Content is accomplished using the ":before" and ":after" pseudo-classes, which denotes whether the content should be added before or after the element in question. You can insert regular "string" content or an embedded object (ie: an image). CSS2's Generated Content is supported in Mozilla/Firefox and Opera 7+, and IE7+
In our first example, we'll automatically add the decorative text ":: " in front of all H3 headers using CSS generated content, and make it red as well:
Dynamic Drive CSS Library
If you're using a capable browser, you should see the effect.
In the next example, you'll see how to include an image as part of the generated content:
The CSS:
Got a question or need help customizing this CSS code? Post it in the CSS Forums. If you have a comment or suggestion instead, post it in the comments section below.
Comment Pages 1 of 4 pages 1 2 3 > Last »
a[href*=".zip"]:after {}
CSS2's Generated Content is supported in Mozilla/Firefox and Opera 7+, and IE7+
you're defining some class at the link and some attributes for h3 in the css.
instead of using this :before and :after-thingies, i'd prefer using a simple background-image including some padding-tags for positioning. at least this would work correct with most browsers.
why this way, where's the difference?
i really can't understand this...
Well, there's nothing "special" about generated content in CSS except the concept itself. The idea is to use CSS Generated Content to dynamically display decorative content that are part of an element's style rather than substance. Using a background image is a lot more tedious in many cases, plus there are instances where you just can't duplicate the same effect using a background image.
See the following tutorial on Generated Content to see what's possible: http://www.javascriptkit.com/dhtmltutors/cssgenerate.shtml
it's not only an "add-the-image"-thing, eh? ;)
thanx for the link!

