Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A HREF color question??? 1

Status
Not open for further replies.

tijerina

Vendor
Mar 4, 2003
132
US
What is the HTML syntax/code do I use to change the color of a link. Right now my sites links default to grey and it looks bad. I would like to change the link to another color.

For example: My click here looks like this click here

And I want it to look like this or something other than grey. click here

Thanks..
 
A text link color can be controlled in any way that you would set the color of any other text.

There's always a better way. The fun is trying to find it!
 
What is the HTML syntax[/]quote]

Yes, you could use a <font color="#ff0000"> tag to change the color of links, but this would be time consuming, and you'd need to make sure you got every link. Besides, the <font> tag is deprecated.

In HTML, you could use:
Code:
<body [COLOR=blue]link="#ff0000" vlink="#990000"[/color]>
The 'link=' sets the color for links. 'vlink=' sets the color for visited links. the '#ff00cc' is the hexadecimal color code.

Doing it this way means that if you want to change the color of your links, you need to change every page. You're better off using css. This means that if you want to change the color or presentation later, you only need to change one file.


add a link to your stylesheet (in the head of the html):
Code:
<link rel="stylesheet" type="text/css" href="name_of_css_file.css">

Add this css into your stylesheet:
Code:
a {color: red;}

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Or, of course, you could add the style definition right into the actual tag (good if you're only doing this for sporadic anchors, rather than site-wide anchors).

[tt]
<a href=" style="color:red">click here</a>
[/tt]

*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
 
cLFlaVA,,
You get a STAR!!


That is exactly what I was looking for!! Thank you very much!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top