CSS2's :before and :after pseudo-selectors are really handy ... but they don't work in Internet Explorer. Nope, not even IE7. I bet you're thinking: "But what if we used as many proprietary Microsoft features as possible all at the same time, that'll show 'em!" And you know what? You're absolutely right. You've just gotta love that this — * { behavior: expression(...); } — can (more or less) enable :before and :after for IE5.5+
With jquery.pseudo.js in the <head/> of your document, you can then do:
p:before, p {
before: 'foo';
content: 'foo'; }
p:before, p .before {
color: blue; }
Images are also supported:
p:before, p {
before: url(foo.png);
content: url(foo.png); }
If you're a standardista (and you should be), you can feed Internet Explorer a separate stylesheet with all the proprietary bits, using a conditional comment:
main.css:
p:before {
content: 'foo'; }
p:before, p .before {
color: blue; }
ie.css:
p {
before: 'foo'; }
before and after applied. What we'd really like to use is p > .before:first-child, but of course, IE5-IE6 don't support those selectors. Avoid nesting, or use p * .before {} fix, and let the specificity war begin :-(