HighDots Forums  

Accessing color of hyperlinks?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Accessing color of hyperlinks? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
KKramsch
 
Posts: n/a

Default Accessing color of hyperlinks? - 07-12-2004 , 12:29 PM










[ This is my second attempt to post this; sorry for repeats. ]

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?

Thanks,

Karl
~
--
Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.

Reply With Quote
  #2  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Accessing color of hyperlinks? - 07-12-2004 , 12:38 PM







"KKramsch" <karlUNDERSCOREkramsch (AT) yahooPERIODcom (DOT) invalid> wrote

Quote:



[ This is my second attempt to post this; sorry for repeats. ]

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?
With client-side script.



Reply With Quote
  #3  
Old   
KKramsch
 
Posts: n/a

Default Re: Accessing color of hyperlinks? - 07-12-2004 , 04:29 PM



In <2lg0k3Fcc4csU1 (AT) uni-berlin (DOT) de> "Harlan Messinger" <h.messinger (AT) comcast (DOT) net> writes:

Quote:
"KKramsch" <karlUNDERSCOREkramsch (AT) yahooPERIODcom (DOT) invalid> wrote in message
news:ccuhpv$2p7$1 (AT) reader2 (DOT) panix.com...




[ This is my second attempt to post this; sorry for repeats. ]

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?

With client-side script.

How??? After scanning all the properties of links (including
"style"), not a single one reveals color.

Karl

--
Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.


Reply With Quote
  #4  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Accessing color of hyperlinks? - 07-13-2004 , 08:39 AM




"KKramsch" <karlUNDERSCOREkramsch (AT) yahooPERIODcom (DOT) invalid> wrote

Quote:
In <2lg0k3Fcc4csU1 (AT) uni-berlin (DOT) de> "Harlan Messinger"
h.messinger (AT) comcast (DOT) net> writes:

"KKramsch" <karlUNDERSCOREkramsch (AT) yahooPERIODcom (DOT) invalid> wrote in
message
news:ccuhpv$2p7$1 (AT) reader2 (DOT) panix.com...




[ This is my second attempt to post this; sorry for repeats. ]

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?

With client-side script.


How??? After scanning all the properties of links (including
"style"), not a single one reveals color.
On second thought, I'm not sure. I was thinking you'd have a link with an ID
attribute, and use that to get its color, but of course you have no control
over whether that link has been visited or not.



Reply With Quote
  #5  
Old   
Steve Pugh
 
Posts: n/a

Default Re: Accessing color of hyperlinks? - 07-13-2004 , 01:23 PM



"Harlan Messinger" <h.messinger (AT) comcast (DOT) net> wrote:
Quote:
"KKramsch" <karlUNDERSCOREkramsch (AT) yahooPERIODcom (DOT) invalid> wrote:
"Harlan Messinger" <h.messinger (AT) comcast (DOT) net> writes:
"KKramsch" <karlUNDERSCOREkramsch (AT) yahooPERIODcom (DOT) invalid> wrote:

Suppose I want to set some color to match the color of (unvisited)
hyperlinks, whatever this color may be (without explicitly setting
this color, of course). How can I specify it?

With client-side script.

How??? After scanning all the properties of links (including
"style"), not a single one reveals color.

On second thought, I'm not sure. I was thinking you'd have a link with an ID
attribute, and use that to get its color, but of course you have no control
over whether that link has been visited or not.
document.linkColor has been a part of the DOM since before the term
DOM was coined (it dates back to Netscape 2 JavaScript).

It will return the unvisited link colour for the document - tests in
IE6 show that it returns the link colour set via <body link="#rrggbb">
or if that isn't set then it returns the browser's default link
colour. It does not return link colours set via author CSS. I doubt it
returns link colours set via user CSS.

So that's a partial solution. In addition you would want to query the
styleSheets[] collection and its styleSheet compoments and find any
the :link definitions. Whilst I believe this can be done I haven't got
the code written already (yeah I'm lazy) and determinging which of
many :link styles is relevant to your goal may be a difficult taks in
itself.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.