Generated Content in CSS2Author: CSS 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 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, though not IE 6.
The word "Chapter:" in each of the headers below are dynamically generated using CSS2:
The music icon image next to the midi links are dynamically added as well:
CSS DriveThe CSS:
h2:before{
content: "Chapter: ";
}
a.music:after{
content: url(icon.gif);
}
The HTML:
<p><b>The word "Chapter:" in each of the headers below are
dynamically generated using CSS2:</b></p>
<h2>1</h2>
<h2>2</h2>
<h2>3</h2>
<p><b>The music icon image next to the midi links are dynamically added as
well:</b></p>
<a href="http://www.cssdrive.com">CSS Drive</a><br />
<a href="music1.mid" class="music">Music1.mid</a><br />
<a href="music2.mid" class="music">Music2.mid</a><br />
What's with the IE incompatibility ? I think this should work with all "state of the art browsers"
Why doesn't this work for me? What am I doing wrong? ontwikkeling
hey it's not working with IE7 !? what can i do ? seo in iasi
Annoucement: I'm looking for a few news posters. Interested?
| CSS Forums: latest threads | Last Post Info |
|---|---|
| How to show an entire pdf in one div (2) | 05/14/2008 11:07 am |
| Starting A Web Design Business - How Do I Attract Customers? (10) | 05/13/2008 02:37 pm |
| Download.. Pacific Wings multicolor menu (1) | 05/13/2008 03:05 am |
| Check out this website I am working on CRITIQUE. (5) | 05/13/2008 01:20 am |
| Tables or Div's? What's you opinion? (18) | 05/12/2008 05:18 pm |