navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

ccs 3: Revealing Links in Print

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Community >> OutFront Discoveries >> ccs 3: Revealing Links in Print
Page: [1]
 
d a v e

 

Posts: 3943
Joined: 7/24/2002
From: England (but live in Finland now)
Status: offline

 
ccs 3: Revealing Links in Print - 12/16/2007 3:14:47   
just found this from O'reilly's CSS:the missing manual

quote:

Imagine a coworker hands you a printout of a fascinating article she found on the Web. You're reading along and come to this passage: "And that's when I found the secret to eternal life here." The underline tells you there's a clickable link that reveals the secret. But on a piece of paper, of course, you have no way to follow where the link leads.

To prevent this conundrum on your own pages, you can make linked URLs print along with the rest of the text: "secret to eternal life here (http://www.pyramind_scam.com/)." Using an advanced selector :afterand an advanced CSS property called content, you can print text that doesn't appear onscreen at the end of a styled element. Unfortunately, the :after selector and content property trick doesn't work in Internet Explorer 6 or earlier (nor in IE 7, as of this writing). But it does work in Firefox and Safari, so you can at least spell out URLs for the benefit of visitors using those browsers.

To do so, add a style to the print style sheet that prints the URL after each link.

You can even add other text items like parentheses to make it look better:


a:after {
content: " (" attr(href) ") ";
}



However, this CSS doesn't distinguish between external or internal links, so it also prints unhelpful document-relative links to other pages on the same site: "Visit the home page (../../index.html)." Using a bit of CSS 3 magic, you can force the style to print only absolute URLs (the ones that begin with http://), like so:

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



Since this style uses yet-to-be-finalized CSS 3 rules, it works only in really new browsers like Firefox and Safari, and even the CSS Validator (Section 2.4.1) doesn't know about it. So if you use root-relative links on your site, you can use another technique to print the correct, full URLs. See this article for more information: www.alistapart.com/articles/goingtoprint/.


_____________________________

David Prescott
Gekko web design
jaybee

 

Posts: 13797
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: ccs 3: Revealing Links in Print - 12/16/2007 5:52:44   
Ahhh yes, there are so many cool things around just none of them work in IE. :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to d a v e)
d a v e

 

Posts: 3943
Joined: 7/24/2002
From: England (but live in Finland now)
Status: offline

 
RE: ccs 3: Revealing Links in Print - 12/16/2007 5:58:08   
yeah but who cares about IE?! lol

anyway it just does nothing in IE i.e. it has no detrimental effects - so you can still use it in proper browsers ;)

_____________________________

David Prescott
Gekko web design

(in reply to jaybee)
Ryokotsusai

 

Posts: 248
Joined: 10/5/2005
Status: offline

 
RE: ccs 3: Revealing Links in Print - 12/17/2007 5:11:40   
That is one of the best reference books I have, as no other book I have read has told me the pros and cons of growing tomatoes in my bathtub:) (read the pages of the example site in the pictures)

_____________________________

The world is more like it is now than it ever has been before.
--Dwight Eisenhower

(in reply to d a v e)
Page:   [1]

All Forums >> Community >> OutFront Discoveries >> ccs 3: Revealing Links in Print
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts