The Disturbed Web Authoring Tutorials   [ H T M L ]   The Disturbed Web Authoring Tutorials
[ T u t o r i a l s ]

[ H T M L ]
[ C S S ]
[ D H T M L ]


[ T i p s ]

[ D e s i g n ]


[ M i s c ]

[ A d d  L i n k ]
[ A d v e r t i s e ]
[ F e e d b a c k ]
[ C o n t a c t ]

[ H o m e ]

Lesson Four

Colours and Backgrounds

In this lesson you will learn how to change the colour of the background, and the text on your webpage.

This bit I am about to explain is new so you better read carefully, or it probably wont work. Tags dont just sit there by themselves, you can add attributes to them, which means they can do more complex things than they were designed to do by themselves. Just before i give some examples, the attributes only occour on the first tag of a tag pair, never on the last.

One of the tag pairings that can have attributes added to it is the <BODY></BODY> pair. Using attributes on this tag we can change the color of the background, text, links, visited links, and active links (links are discussed in Lesson 6

In your text editor, open up your page from the previous lessons, and then replace the <BODY> tag with <BODY BGCOLOR="#FFFFFF" TEXT="#0000FF"> (the link, vlink, and alink attributes work exactly the same as these two attribures so you can add them when you have links in your page).

Your page background should be white, and the text should be blue. Now you are probably wondering, what all those F's mean. Well ill tell you. To make up the colours, there are 3 colours, Red, Green and Blue, all of which have 255 gradings each. If you know anything about maths, or computers, you may have already made the link. 255 when converted into hexidecimal (base 16) is FF. For those who don't know what hex is, the numbers we use in everyday life are in base 10, 0 1 2 3 4 5 6 7 8 9. When we count above 9 we add a 1 infront of the next number (which is 0) to make 10. But in hex instead of having 10 base numbers, there are 16. 0 1 2 3 4 5 6 7 8 9 A B C D E F. F is equivilent to 15 in base 10, and when we add one more to it, it equals 10. I know you are saying, that is toooooo complicated, and it is, so here is what you have to remember.

The RGB colour code is a # (hash) followed by 6 hexidecimal numbers (0 - F). The first 2 hex numbers are the grading of Red in the final colour, the next 2 hex numbers are the grading of Green in the colour and the last 2 hex numbers are the grading of Blue in the final colour. So #FF0000 is red, #00FF00 is green, and #0000FF is blue. You can now fiddle with these to find the colours you want for your page. But dont fiddle for too long, because there are exactly 16 581 375 different colours that you can make. Just so you have a start, #000000 is black, and #FFFFFF is white.

Now that all that theory is out of the way, it is time to progress to the next lesson

Last modified Thursday 27 January 2000
© 1999 - 2000 Paul Woods
All Rights Reserved
1