Y!Geocities Welcoming & Help Team
HTML Primer


Table of Contents
HTML
Required Elements
General HTML:
Adding Colors:
Formatting Text
Images & Graphics
Advanced
Special Characters
The Basics of Colors in Webpages

There are two basic ways to control the color of your text, text links, and background area behind the text and links. One way is to set the overall "default" colors using several arguments or parameters to the <BODY> HTML tag (which should be near the top of your html file. The other way is to set each text item or link individually. You can use one method or a combination of both - whatever you like! One thing you want to keep in mind, however - If you do use an individual setting on an item, it will override the default setting in the <BODY> statement for that one item.

General Tips:

  • For emphasis, all my HTML examples show the statements in uppercase characters. In reality, the HTML statements can be upper, lower, or mixed case. It's a very good idea to decide which method you prefer, and adhere to it as a personal standard for all your own HTML coding, however.
  • Proper, mixed case characters are the best for the text in your webpages, if you want people to actually stop and read them. It is up to you, as the webmaster of your very own site, to make your pages as you see fit, because they are yours! But, if you "SHOUT" WITH ALL UPPERCASE, or "drone" with all lowercase, or sHoW tHe wOrLd JuSt hOw RaD -n- sKa you are, you will probably have a number of your site visitors flee soon after they arrive.

The Text Color (TEXT) Parameter

To set the default color for all the text in your page (excluding any text which is part of an active link), we can add the TEXT= parameter inside the <BODY> HTML tag. For example, to make all the text on your page black, our BODY statement would look like this:
<BODY TEXT="black">.
That was simple!
This is useful if you want some or all of the text on your page to be the same color. That way, you can control or change the color simply by changing the setting in one place. Another benfit to this method is that it can be overridden for specific sections of text on your page.
Since this is part of the <BODY> HTML tag, it is effective up to the </BODY> HTML tag at the end of your page.

Tips on using the TEXT color parameter:

  • Select a color that contrasts well with your background, regardless of whether you are using a solid color or a graphic image for your background. People may skip over your site without reading it if it is hard to read.
  • Don't overdo the use of color - try to keep most of your text all the same default color. Emphasizing text items by displaying them in a different color loses effectiveness quickly if it's done too much.

Back to this Page's Table of Contents

The Background Color (BGCOLOR) Parameter

The background color of your page is very important - it is the blank canvas upon which you paint your cyberspace masterpiece. The background is not to be taken lightly. There are tens of thousands of webpages all over the web that are ruined simply because of a poor choice in a background. You have a choice of having either a graphic image or a solid color as your background. Using an image as a background will be dealt with in another section - here, we will illustrate setting a solid color as a background. Let's look at the code to make our background a light dove grey:
<BODY TEXT="black" BGCOLOR="lightgrey"> .
See? You don't have anything to worry about - this HTML stuff isn't so bad, is it?

Tips on using the BGCOLOR color parameter:

  • Select a color that is easy on the eyes to look at. "Fire Engine Red" or "Blazing Yellow" are very attention-getting, but your page viewers will get tired of them very quickly, and move on.
  • Workplace studies have shown that whites or light pastels make the best background colors for lengthy viewing. And, if you feel up to a little trickery, there are many studies on the psychological effects of certain colors on the human mind! You're already out on the Web, what are you waiting for? Go Explore!

Back to this Page's Table of Contents

The Link Color (LINK) Parameter

To set the color for all the text links in your page, we can add the LINK= parameter inside the <BODY> HTML tag. For example, to make all the text links on your page dark blue, we would add the following LINK parameter to our BODY statement that we started above, to make it look like this:
<BODY TEXT="black" BGCOLOR="lightgrey" LINK="darkblue">.
Beginning to see a pattern here? The format, or "syntax", of the statement is just like the one above; only the parameter name "LINK" is different.

Tips on using the LINK color parameter:

  • It's a good practice to make your links a different color than your text, because you want it to be easy for the reader to know that they are links, rather than text.
  • Try to select a color that compliments, rather than clashes or contrasts, with your text color.
  • Make sure your LINK color does contrast strongly with your background, though!

Back to this Page's Table of Contents

The Visited Link Color (VLINK) Parameter

Let me introduce you to a new kind of color parameter - one that has a "mind of it's own"! This parameter remembers which links you've already been to, and which ones you haven't yet visited. This allows your page readers to quickly tell which pages they have already seen, so they don't waste their time by going to the same place twice. Let's say we want to make all the links to places we've already visited a nice, environmentally-friendly green. Let's look at what we would add to our BODY statement:
<BODY TEXT="black" BGCOLOR="lightgrey" LINK="darkblue" VLINK="green">.

Tips on using the VLINK color parameter:

  • Try to select a color that does NOT contrast quite as much as the color you've selected for unvisited links. You want to direct your viewer's attention more towards the links remaining to be visited, and away from the ones they've already seen. Try to make them "fade into the background" just a little bit.
  • You might even have a case here for making visited links the same color as your text, but I would still recommend making them their own distinctive color. A user might WANT to go back and see one of your pages again, and we certainly don't want to disappoint them!
  • Never annoy your webpage readers!

Back to this Page's Table of Contents

The Active Link Color (ALINK) Parameter

While we're on the subject of Link colors, here's one additional parameter you can use. This one is only visible for a fraction of a second, so it's not used very much, but I'll go ahead and tell you about it. This parameter will change the link to the specified color only as it's being clicked by the reader. It can be used as kind of like a visual confirmation to the page reader that they did in fact click on the link. Here's how to make your links show up a bright yellow while they are being clicked:
<BODY TEXT="black" BGCOLOR="lightgrey" LINK="darkblue" VLINK="green" ALINK="yellow">.

Tips on using the ALINK color parameter:

  • This only lasts while the mouse button is down, so you can't get yourself into trouble here. If you were the devious type (like me), you could even make the link "disappear" by making it the same color as your background. But, don't let me lead you down that dark path....
  • First things first, but not necessarily in that order....

Back to this Page's Table of Contents

The Font Color (FONT COLOR)Statement

Now, at last we come to the "other" way of setting our colors - the way to set items midstream in the page, overriding the default settings. This is the best way to highlight a word or phrase within the text of your page. We accomplish this by enclosing the letter, word, or phrase with the <FONT COLOR=> and the </FONT> html tags. Like most all HTML tags, there is a beginning and and ending tag, and the statement affects everything between the beginning and ending tags. You notice how I made the word "beween" appear in dark cyan in the previous sentence? Let me show you how I did it:
...everything <FONT COLOR="darkcyan"> between </FONT> the...
Suppose you wanted to make just one letter in a word a different color? It works just the same way, just look at this:
...just <font color="darkcyan"> o </font> ne letter...
We can also do whole sentences and paragraphs, just by carefully positioning where the ending </FONT> is.
How about something that's really, REALLY exiting? I just "nested" one "FONT COLOR"..."/FONT" statement group inside another "FONT COLOR"... "/FONT" group. Want to see what it looks like? I knew you did, that's why I already typed it up for you right here:
...something that's <FONT COLOR="darkcyan">really, <FONT COLOR="lime">REALLY</FONT> exiting</FONT> ?...
Notice how when the inner statement group was closed out, the outer one was still in effect, and the word "exiting" displayed in dark cyan, until it was properly ended with the second "/FONT" tag. This can be very useful if you plan it this way, or it can really catch you by suprise if you didn't mean for it to happen.

Tips on using the FONT COLOR statement:

  • One of the easiest mistakes to make when using the <FONT COLOR=> statement is to forget to put in the closing </FONT>. If you do, everything after the "FONT COLOR" will be affected until it finds the next available "FONT" tag, or the end of the page, whichever occurs first.
  • If you have so many of these in your page that it's becoming difficult to keep track of them, then you probably have too many! Of course there always exceptions, but the K.I.S.S. rule generally applies here.

Back to this Page's Table of Contents

Color Table

In these examples, I have opted to use the literal color names. Older browsers used to refer to colors by hexadecimal color pairs, but this made for cumbersome coding, since every time you wanted a specific color, you had to look it up in a color chart to see the corresponding hex value. Newer versions of browsers can now directly reference standard colors by name, making it a lot easier to code colors into your html files. I have included a table below that references many of the available colors by their name. If you would like to see a table of colors by hex codes, Click here.
If a color name does not seem to match the color displayed, then in all likelihood your browser doesn't support that color name.

white whitesmoke floralwhite
antiquewhite ivory linen
snow oldlace honeydew
mintcream azure beige
bisque cornsilk lemonchiffon
lightgoldenrodyellow lightyellow blanchedalmond
ghostwhite moccasin navajowhite
lightgrey mistyrose palegoldenrod
papayawhip gainsboro lavender
lavenderblush lightcyan seashell
wheat khaki peachpuff
pink lightpink paleturquoise
powderblue silver thistle
burlywood gold darkorange
darksalmon coral goldenrod
darkgoldenrod darkkhaki chocolate
orange peru sandybrown
tan lightsalmon salmon
sienna brown rosybrown
saddlebrown firebrick darkred
maroon orangered red
tomato crimson indianred
lightcoral hotpink magenta - FF00FF
deeppink orchid fuchsia
plum palevioletred mediumorchid
mediumvioletred violet darkviolet
darkorchid darkmagenta purple
mediumpurple indigo deepskyblue
darkblue dodgerblue royalblue
slateblue steelblue blue
blueviolet midnightblue navy
mediumslateblue mediumblue cadetblue
darkslateblue skyblue lightskyblue
lightblue aqua cyan
lightsteelblue mediumturquoise darkolivegreen
chartreuse cornflowerblue gray
green greenyellow darkcyan
darkseagreen lawngreen darkgray
darkgreen lightgreen forestgreen
lightseagreen darkslategray lightslategray
darkturquoise lime limegreen
mediumaquamarine mediumseagreen mediumspringgreen
olive olivedrab palegreen
dimgray seagreen slategray
springgreen teal turquoise
yellow aquamarine yellowgreen
black

Back to the Table of Contents


Last modified on August 05, 1999 by The ComputerThug
Images and original project design Copyright © 1998 Kristin

This page is hosted by GeocitiesGet your own free page!

You are visitor number