On 11/24/10 7:54 PM, Keith Purtell wrote:
On 11/12/2010 3:46 PM, David Hucklesby wrote:
------------------------------ Subject: Re: [css-d] Internal site
links handled in print style sheet
On 11/10/10 5:09 PM, Keith Purtell wrote:
I'm using this CSS ...
a[href^="http://"]:after { content: " (online at:
"attr(href)")"; }
...to handle links to external sites when a visitor prints one
of my pages. However, I occasionally refer to related pages
within my own site/file directory. Not sure how to handle these
links in the print.css style sheet.
Oddly, there was a useful discussion of this kind of issue over at
the Web Standards Group recently:
<http://www.mail-archive.com/[email protected]/msg41914.html>
David,
I've been puzzling over the contents of that link ever since you
responded. The answer to the question in that discussion seemed to be
in Jason Arnold's post where he talked about ...
a[href^="http"] and a[href*="sitethatisnotanexternalsite.com"]
But, if I understand him correctly, his solution would mean using
absolute URLs to handle the internal links. Have I misinterpreted? I
noticed the difference between the use of the ^ and the * and
wondered if this was syntax like the methods I've used in regular
expressions, but I couldn't find an explanation on the Web of what
these two different symbols do here.
Indeed, that is the case. As the first message states:
"Problem is almost every CMS system uses absolute url for internal link..."
If, instead, you are using links relative to the root or the document,
you can simply apply a style to all A tags, then override that style for
links beginning "http" and links beginning "#" to distinguish external
and in-page links from the rest.
I see that Philippe gave you a link explaining how those attribute
selectors work. :)
Cordially,
David
--
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/