473,498 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

kj

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.
Jul 20 '05 #1
1 1939
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.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4415
by: Rainer Herbst | last post by:
Hi *, please consider the following problem: I have a XML document which includes some html elements. I want to replace only the <div> element: I specified two templates, one matches...
8
2132
by: Timothy Casey | last post by:
Is there any way to code an external style sheet to ensure that all pages opening with a reference to that style sheet include generic content such as headers, logos, taglines, universal navigation...
3
1814
by: Fred | last post by:
this is a problem i can't figure out. I can't get IE to link to a new widown with width/height attributes as i can in other browsers. It works in NN, Op, Moz. The code is all on the same line as...
3
3216
by: Yeah | last post by:
I have an HTML table with two columns of text. Here's what it looks like: FIRST COLUMN (each cell is ID="date') Background orange, font Serif size 13px, aligned center SECOND COLUMN (each cell...
8
25023
by: John Baker | last post by:
Hi: Access 2000 W98! I have a table with numerous records in it, and am attempting to delete certain records that have been selected from it. These are selected based on the ID number in a...
6
1333
by: Jake Barnes | last post by:
This function has always worked for me just fine: function nl2br_js(myString){ // 02-18-06 - this function imitates the PHP command nl2br, which finds newlines in a string // and replaces them...
37
4150
by: Jan Wagner | last post by:
Hi, can't figure this one out, what's the CSS way to specify the language? In HTML it would be simply an lang="xx" attribute, or XHTML xml:lang="xx", but, how about in CSS? This would be...
14
1538
by: eric.goforth | last post by:
Hello, Is there any way to directly access an element in a nodeset? For example, if working with: <blahs rec_count="16"> <blah> <yada>abc</yada> </blah>
10
1858
by: somebody | last post by:
There are two files below named search.c and search.h. In the for loop in search.c, the for loop never exits, even if mystruct.field1 has no match. Instead of exiting the for loop it keeps going...
0
7124
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.