<font> tag is also used to change text colors using the same tag and also how todo both in the same line. The syntax is the similiar. Only replace size by color:
<font color="green"> This is what youwill see! </font>
Now if you replace the word green with blue, red, yellow or black, thenthe line in between will be displayed in that color. Try different colors to see which colors are accepted. Remember that you should only use lowercase letters for the colors. Below are some samples.
<font color="red"> +6 is thisbig </font>
<font size="blue"> +4is this big </font>
<font size="yellow"> +3is this big </font>
Suppose you want the yellow to be a slighty less brighter, or a shade which is a mix of red and blue. How do you put that color on your webpage? Is it possible or is it not? You know that it is possible because you haveseen so many varying colors and shades on the Internet. I will now show you how to do it, but it is a bit technical. I will try to clarify as much as I can.
Computers use binary numbers (1 and 0) only. To simplify, hexadecimal (base 16) numbers are used. We are used to base 10 numbers meaning that there are 10 basic digits (0-9). Binary is base 2 meaning that there are two numbers ( 0 and 1 ). Since there is no digit after 1, the next number will be 10, 11, 110, and so on. Hexadecimal numbers are:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D,E, F
where A is 10 in base 10, B is 11 in base 10, and so on. This way 10 hex will be 16 in base 10. Now why am I suddenly talking about all this numbers mumbo jumbo. Don't worry if you do not understand it. The reason I mentioned this was to show you what A, B, C, D, E, and F mean and why they are used. All you need to know is that A is a bigger number than B which is a bigger number than C and so on to F.
Now lets get back to colors.Scientists have discovered long ago that, any color or shade canbe produced by the right combination on Red, Green and Blue. In computer world this is call RGB (short for Red, Green, and Blue. I will be using this term). These RGB values can be used in HTML to specify a color.Let's look at the syntax:
<font color="#xxxxxx"> x can be any number between 0 and F </font>
The left two digits specify the redness, middle two digits specify the greenness, and the two digits on the right specify the blueness. FF isthe most intense and 00 is the least. FF hexadecimal is equivalent to 255 in base 10. So we now have 255 x 255 x 255 = 16581375 possible combinations of colors and shades! Now Observe:
<font color="red"> is equivalent to <font color="#FF0000">
<font color="green"> is equivalent to <font color="#00FF00">
<font color="blue"> is equivalent to <font color="#0000FF">
As you can see, these are the maximum intensities of red, green, and blue that you can get. You can also use this aroundthe heading tag to color it.
<font color="blue"><H3>You can also use RGB values</H3></font>
Default text color is black, what if you want your default to be some other color for that page. All you have to do is specify the following inside the body tag:
<body font color="blue">
or
<body font color="#xxxxxx">
where x is any number. Its now time to combine what we learned in the previous lesson and this lesson. We can define both size and color in the same tag. For example we want a font size of +4 and the color to be blue.
<font size=+4 color="blue">DONKEY </font>
As you can see the word donkey is of size +4 and is blue. Try all this before you move to the next lesson.