Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | PHPBB Forum Deleted Topics?

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion
Register FAQ Community Calendar

HTML Link Colour
Reply
 
Thread Tools
Old 21-08-2010, 16:51   #1
LSainsbury
Guest
 
Location: Near Hungerford, West Berkshire
Services: TV: Sky HD, Landline: BT, Mobile: Orange, Internet: Quite Slow!
Posts: n/a
HTML Link Colour

Hi,

HTML for Thickies #101

How do I change a HTML a href link colour?


I've read there can be different colours for the link depending on the state (never clicked, clicked etc) but I want it one colour (white) regardless of it's state.

How do I do that?

Thanks!
  Reply With Quote
Advertisement
Old 21-08-2010, 18:03   #2
Sir John Luke
Inactive
 
Join Date: Sep 2008
Posts: 562
Sir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful oneSir John Luke is the helpful one
Re: HTML Link Colour

http://www.codeave.com/html/code.asp?u_log=5027
Sir John Luke is offline   Reply With Quote
Old 21-08-2010, 18:14   #3
punky
Inactive
 
Join Date: Jun 2003
Age: 44
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
Re: HTML Link Colour

Quote:
Originally Posted by Sir John Luke View Post
That's the old way.

In your CSS file add this:

Code:
a:link {
color:#FF0000;
}
a:visited {
color:#FF0000;
}
a:hover {
color:#FF0000;
}
a:active {
color:#FF0000;
}
link = link hasn't been clicked
visted = link has been viisted
hover = mouse is over link
active = mouse is clicking link

The order they are listed is crucial!

Colours are numbers between 0-255 (as strength) converted to 2 digit hexadecimal (so 0 = 00 and 255 = FF) in the order Red Green Blue with no spaces and has a # at the start.

So red is #FF0000 etc. Black is #000000 and white is #FFFFFF
punky is offline   Reply With Quote
Old 21-08-2010, 20:22   #4
punky
Inactive
 
Join Date: Jun 2003
Age: 44
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
Re: HTML Link Colour

Just noticed you wanted your links white so it should be:

Quote:
a:link {
color:#FFFFFF;
}
a:visited {
color:#FFFFFF;
}
a:hover {
color:#FFFFFF;
}
a:active {
color:#FFFFFF;
}
punky is offline   Reply With Quote
Old 21-08-2010, 21:26   #5
dev
Inactive
 
Join Date: Jan 2004
Posts: 1,164
dev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond reputedev has a reputation beyond repute
Re: HTML Link Colour

Easier to just put them in one go:

Quote:
a:link, a:visited, a:hover, a:active { color: #FFFFFF; }
dev is offline   Reply With Quote
Old 22-08-2010, 00:31   #6
LSainsbury
Guest
 
Location: Near Hungerford, West Berkshire
Services: TV: Sky HD, Landline: BT, Mobile: Orange, Internet: Quite Slow!
Posts: n/a
Re: HTML Link Colour

Cool - thanks - so where do I inset that code into the <a href> command?
  Reply With Quote
Old 22-08-2010, 00:38   #7
Strzelecki
Inactive
 
Join Date: Jan 2004
Location: Essex
Age: 43
Services: 80/20Mbps FTTC on Freeola
Posts: 871
Strzelecki has reached the bronze age
Strzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze age
Re: HTML Link Colour

If you want the styling inline with the href tag then you will have to use something like:
Code:
<a style="color:#FFFFFF;" href="my-page.php">Link text</a>
The code others have posted should either be in a separate stylesheet included on the page in the <head> section, like:
Code:
<head>
<link rel="stylesheet" type="text/css" href="mystylesheet.css" />
</head>
<body>
.....
or in <style type="text/css"></style> tags in the <head> section.
Strzelecki is offline   Reply With Quote
Old 22-08-2010, 10:10   #8
LSainsbury
Guest
 
Location: Near Hungerford, West Berkshire
Services: TV: Sky HD, Landline: BT, Mobile: Orange, Internet: Quite Slow!
Posts: n/a
Re: HTML Link Colour

Thanks for the advice - all fixed up!
  Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:45.


Server: osmium.zmnt.uk
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum