Post Archive

› December 15, 2004

Print HREFs on Links for Print StyleSheet

  • Reported by Russ

An interesting article by Richard Czeiger on Printing HREFs on Links.

MSIE doesn't support the ":after" pseudo-element, so Richard has created some code that replicates that functionality for all browsers.

Comments

1. December 29, 2004 10:47 AM

Quote this comment

Daniel Schierbeck Posted…

Using the CSS 3 attribute selectors you can apply the HREF only to external links if you wish to.

a[href^="http://"]:after {
   content: " [" attr(href) "] " ;
}

There is, of course, no reason to believe that M$ will support it...

2. December 29, 2004 11:09 AM

Quote this comment

Daniel Schierbeck Posted…

Oh, and while I'm at it, it's better to use " [" attr(href) "]" (the last white-space is removed,) so it doesn't look weird if the link immediately precedes a punctuation mark.

3. January 4, 2005 06:45 PM

Quote this comment

Richard Posted…

Hi Daniel - the **whole** point of the article is that MSIE doesn’t support the “:after” pseudo-element!