determin color of a specific hyperlink

  • Thread starter Roy G. Vervoort
  • Start date
R

Roy G. Vervoort

Is it possible to determin the color of the visible tekst of a specific
hyperlink. I want one link to be another color then the other links after i
have clickt it.

thnaks

roy
The Netherlands
 
E

Els

Roy said:
Is it possible to determin the color of the visible tekst of a specific
hyperlink. I want one link to be another color then the other links after i
have clickt it.

Yes, you can give that one particular link a class, and
style it in the css file or in the head of the file:
<style type="text/css">
..different a:visited{color: rgb(171,7,247);}
</style>
</head>
<body>
<a href="anotherpage.html" title="" class="different">go
here</a>
 
M

Matthias Gutfeldt

Roy said:
Is it possible to determin the color of the visible tekst of a specific
hyperlink. I want one link to be another color then the other links after i
have clickt it.

Not sure I understand exactly what you want, but below is the usual way
to specify link colors with CSS. Put this in the HEAD of the document

<style type="text/css">
a:link {color:blue; background-color:white;}
a:visited {color:purple; background-color:white;}
a:hover {color:red; background-color:white;}
a:active {color:black; background-color:white;}
</style>


More information about CSS selectors: <http://w3c.org/TR/CSS2/selector.html>


Matthias
 
S

Steve R.

Roy G. Vervoort wrote in message ...
Is it possible to determine the color of the visible text ?

<body link="#FF00FF" vlink="#FFFF00" alink="#FF0000">

That will give you a purple link, a red 'active' link and a yellow
'visited' link.

Change the coulours to suit your preference.
 
M

Matthias Gutfeldt

Steve said:
Roy G. Vervoort wrote in message ...

<body link="#FF00FF" vlink="#FFFF00" alink="#FF0000">

OUCH! Please don't take offense, but this is SUCH an outdated method.
Basic text styling is best done with CSS.


Matthias
 
R

Roy G. Vervoort

This one i knew, Els gave me the possible sollution. Your code gives al the
links a specific color and i want one specific link to be a specific color

thans anyway

roy
 
S

Steve R.

Matthias Gutfeldt wrote in message ...
OUCH! Please don't take offense, but this is SUCH an outdated method.
Basic text styling is best done with CSS.

But the way I indicated works, and requires much less markup than the CSS
way.

Why 'bloat' HTML when you don't need to ?
 
C

Cameron

Steve said:
Matthias Gutfeldt wrote in message ...



But the way I indicated works, and requires much less markup than the CSS
way.

Why 'bloat' HTML when you don't need to ?

Apparently because it's the new and best way of doing it and we all must
jump on board!, so I'm told at least, no doubt people would throw a
hissy fit because I'm currently using C instead of C++ ;)

~Cameron
 
N

Nicolai P. Zwar

Steve said:
Matthias Gutfeldt wrote in message ...



But the way I indicated works, and requires much less markup than the CSS
way.

Why 'bloat' HTML when you don't need to ?


That's certainly a good question. The basic answer would be that when
you do it "the new way", the presentational mark-up of the document will
be separate from the content, which is in most cases a very desirable
thing. (It will be "separate" from the content even if the CSS markup is
physically still present in the same file, simply because the
(X)HTML/CSS syntax can be interpreted by modern browsers and a multitude
of other possible processing devices and so they "know" what is content
and what is presentation.
 
M

Matthias Gutfeldt

Steve said:
Matthias Gutfeldt wrote in message ...



But the way I indicated works, and requires much less markup than the CSS
way.

That depends. For one single page, and only the link styles, you're
probably right. But once there's more than just one page, and the
styling gets a bit more involved, a linked stylesheet usually has less
code than all those presentational HTML attributes and other markup
hoops required to get the desired layout/design.


Matthias
 
R

Roy G. Vervoort

Everybody keeps saying it is so simple but no one has given me the solution.
Maybe i did not descripe the problem clear enough so i try again.

After the page is loaded al the links are purple with one exeption, one link
is green. when ik click this link the link has to become red. Al the ohter
links should becom yellow when i have clickt them

thanks

roy
 
W

Whitecrest

Yes, you can give that one particular link a class, and
style it in the css file or in the head of the file..

And I can override it. So the "true" answer is NO you can't.

But in the real world, the CSS solution offered will work almost all the
time.
 
S

Steve R.

Matthias Gutfeldt wrote in message ...
That depends. For one single page, and only the link styles, you're
probably right. But once there's more than just one page, and the
styling gets a bit more involved, a linked stylesheet usually has less
code than all those presentational HTML attributes and other markup
hoops required to get the desired layout/design.

But presumably there's a call on the server to the linked stylesheet to
establish the syle for the new page which is loading, so the end result is
the same ... Yes ? No ?
 
M

Matthias Gutfeldt

Roy said:
Everybody keeps saying it is so simple but no one has given me the solution.
Maybe i did not descripe the problem clear enough so i try again.

After the page is loaded al the links are purple with one exeption, one link
is green. when ik click this link the link has to become red. Al the ohter
links should becom yellow when i have clickt them

Several people have given you solutions, but perhaps it helps if you
check out the ciwas FAQ:

"How can I suggest a different link appearance in various sections of my
page ?" <http://css.nu/faq/ciwas-aFAQ.html#QA08>


Matthias
 
E

Els

Steve said:
Matthias Gutfeldt wrote in message ...



But presumably there's a call on the server to the linked stylesheet to
establish the syle for the new page which is loading, so the end result is
the same ... Yes ? No ?

No, I don't think so.
I'd say the css file is called from the cache after being
downloaded for the first page.
And what about the styles that are in the stylesheet to
handle *all* images in one page, or *all* <h1>'s in the
page? That's a lot of markup that is only one line in css.
 
E

Els

Roy said:
Everybody keeps saying it is so simple but no one has given me the solution.
Maybe i did not descripe the problem clear enough so i try again.

After the page is loaded al the links are purple with one exeption, one link
is green. when ik click this link the link has to become red. Al the ohter
links should becom yellow when i have clickt them

hmm... in your message of 13.03 you say my solution might
work, and now you say it doesn't.
But I think my answer was correct and to the point to solve
your problem.
What exactly didn't work?
 
S

Steve Pugh

Roy G. Vervoort said:
Everybody keeps saying it is so simple but no one has given me the solution.
Maybe i did not descripe the problem clear enough so i try again.

After the page is loaded al the links are purple with one exeption, one link
is green. when ik click this link the link has to become red. Al the ohter
links should becom yellow when i have clickt them

In your CSS:

a:link {color: #660066;}
a:visited {color: #FFFF00;}
a.special:link {color: #00FF00;}
a.special:visited {color: #FF0000;}

In your HTML:
<a href="foo">normal link</a>
<a href="bar" class="special">special link</a>

Steve
 
S

Steve Pugh

Steve R. said:
Matthias Gutfeldt wrote in message ...

But presumably there's a call on the server to the linked stylesheet to
establish the syle for the new page which is loading, so the end result is
the same ... Yes ? No ?

Once, for the whole site. After that the stylesheet is cached.

Steve
 
M

Matthias Gutfeldt

Steve said:
Matthias Gutfeldt wrote in message ...



But presumably there's a call on the server to the linked stylesheet to
establish the syle for the new page which is loading, so the end result is
the same ... Yes ? No ?

Why don't you write a simple test case and find out?


Matthias
 
R

Roy G. Vervoort

I said "might". (ha ha)

The link is already colored when i load the page and i would like it only to
chage color after i have clicked it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top