Wherein Torgo the Load Asks for Free HTML Advice

How do I code a link so that the link text shows up as some color other than blue? Can I code it so that it appears as any color I choose?

Thanks in advance!

The best way is to use Cascading Style Sheets. A simple example of an inline style sheet (i.e., the stylesheet is not in a separate file) is:



<html>
<head>
  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
  <style>
a:link { color: red }
a:visited { color: yellow }
a:hover { color: green }
  </style>
  <title>Link Colour</title>
</head>
<body>
This is a <a href="http://www.google.com">link</a>. <br>
</body>
</html>


Commonly, you will place all your style definitions (fonts, colours, padding and so on) in a separate file, and include that file with every page giving a common look and feel to your site.

Include the file with HTML such as:



<LINK rel="stylesheet" href="mystyles.css" type="text/css">

in the <head> of your document.

You can use any colour you want.

Resist the temptation to define styles in the page!

Thanks Marcus! I’m currently learning to use CSS but was just wondering if there was a quick and dirty way to HTML it.

If you want it to apply to the whole page, the “quick and dirty html way” is to put it in the body tag:

<body text="#000000" link="#00dd33" vlink="#333333" alink="#00dd33">

If you want different colors for individual links, you gotta us CSS.

Sure. Put this in the body tag:

The numbers can be changed to make different colors.

Thanks to all; if it was feasable I’d send you all a nice meatloaf.

Changing the default standard colors for things like links is bad HTML programming. People get very used to the colors of links (and visited links). Expect your site to be less functional as a result.

But since bad HTML programming is the only way things are done nowadays, I (and many other people) set their browsers to ignore such poorly thought out color manipulations. I.e., it will still look blue-ish to me.

Yes and no. Links that don’t look like links are bad, certainly, but that doesn’t mean that every link should be blue/purple. I’m sure there’s room for a balance between design and usability.

Then there are web standards and accessibility requirements that many web sites strive to make, and countless more don’t give a rat’s behind. And in some cases, there is no leeway - the law requires it.

Absolutely.

Personally, I believe that the vast majority of websites are horribly inaccessible, and would all benefit from some genuine thought. I also believe that being accessible doesn’t mean following one absolute standard with no flexibility or room for individual design.