"Harlan Messinger" <h.*********@comcast.net> wrote:
"KKramsch" <ka*******************@yahooPERIODcom.invalid> wrote:"Harlan Messinger" <h.*********@comcast.net> writes: >"KKramsch" <ka*******************@yahooPERIODcom.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 <st***@pugh.net> <http://steve.pugh.net/>