DZone: Your Personal Tech Universe Web Builder Zone
Published on Web Builder Zone (http://css.dzone.com)
Optimize Your Links For Print Using CSS: Show The URL
By davidwalsh
Created 2008/02/28 - 12:55am

When moving around from page to page in your trusty browser, you get the benefit of hovering over links and viewing the link's target URL in the status bar. When it comes to page printouts, however, this obviously isn't an option. Most website printouts simply show the link as text with an underline. What good is that?

Providing URLs for links in the print version of your page can be extremely helpful to the reader. Using a small snippet of CSS code, you can get printouts to display link URLs right next to the link text.

The CSS Code

a:link:after, a:visited:after { content:" [" attr(href) "] "; }

The pitfall of this method of displaying links URLs for print is that Internet Explorer ignores this code. If showing link URLs is critical, I'd recommend using a javascript alternative. If not, add this snippet to your print stylesheet to make your page print-outs more informative.

Click here [1] for an example!


Source URL: http://css.dzone.com/news/optimize-your-links-print-usin

Links:
[1] http://davidwalsh.name/dw-content/css-links.php