In our last episode, <ce**********@reader1.panix.com>, the lovely and
talented kj broadcast on comp.infosystems.
www.authoring.stylesheets: I want to specify the color of certain style sheet element (say
p.foo) to match the color of (unvisited) hyperlinks:
p.foo { color: ??? }
What should I replace ??? with to ensure that the color of p.foo
elements matches the color of unvisited hyperlinks?
Your best chance is to set unvisited hyperlinks yourself:
A:link { color: ??? }
p.foo { color: ??? }
where ??? is the same value. (You should also get in the habit of
setting background-color every time you set color, even if you want
to set it to transparent.) ??? may show up differently in different
browsers, but it should be the same difference in p.foo and A: link.
Of course this is not guaranteed to work because link colors are the
sort of thing people like to set themselves, and some people will set
their browsers to trump you.
A very distance second best is to match the default link color of
your favorite browser. Many paint programs will allow you sample
from your browser's color preference window. The big flaw in this is
that if someone has had the poor judgment to choose another browser
(or even a different version of that browser or overall color depth)
or to change the default, you are just matching a figment of your
imagination.
So far as I know, you cannot get the color of links as set by the
user with CSS alone. That sort of thing requires a scripting
language.
--
Lars Eighner -finger for geek code-
ei*****@io.com http://www.io.com/~eighner/
If it wasn't for muscle spasms, I wouldn't get any exercise at all.