Add content with CSS

March 15th, 2005

I had a use for some flashy CSS 2.0 code the other day. I couldn’t find it in my library, which was really annoying. I’ve decided to store various bits of handy code on here. Here’s the first:

a:after {
   content: " (" attr(href) ") ";
   font-size: 80%;
   }

Add the content rule to anchors in your print stylesheet as aboue & you’ll have lovely little URL’s of each link placed in brackets after the link content.
This doesn’t work on Internet Explorer though. Does work on Firefox. So think of is as an enhancement rather than rely on it.

§ 2 Responses to “Add content with CSS”

What's this?

You are currently reading Add content with CSS at Brainfire.

meta