Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

How to specify color to match a:link { color: ... }
 

kj




quote this post edit post

IP Loged report this post

Old Post  07-31-04 - 12:16 AM  


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?

Thanks!

kj

--
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.


Post Follow-Up to this message ]
Re: How to specify color to match a:link { color: ... }
 

Lars Eighner




quote this post edit post

IP Loged report this post

Old Post  07-31-04 - 12:16 AM  
In our last episode, <ceeaen$18h$1@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-  eighner@io.com [url]http://www.io.com/~eighner/[/u
rl]
If it wasn't for muscle spasms, I wouldn't get any exercise at all.


Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 03:16 PM. Post New Thread   
  Previous Last Thread   Next Thread next
Stylesheets archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top