In HTML programming the font appearance is set using the tag pair <FONT>and </FONT>. Additional parameters may be included within the opening part of the font tag to define the parameters.
Color
In the following example I will set some text to the colour blue.
My example text:
some of which is blue in colour.
some of which is <FONT color=blue>blue</FONT> in colour.
In the above example I have used a named colour. There is a limited set of colurs which are known by name. The other method for defining the colour used is a little harder to follow. In our example I could have defined the colour by color=#0000ff. The colour is now defined by 3 pairs of numbers, representing the combination of red, green and blue which forms the colour. Because the numbers used are in hexadecimal this translates to a number between 0 and 255 (decimal) for each of the three colours.
Size
This parameter may be used to control the size of the text. size="2" will give a larger font than size="1".
My example text:
used to illustrate two different sizes of font.
used to illustrate <FONT size=1>two</FONT> different <FONT size=2>sizes</FONT> of font.
Using numbers to represent the font size, as in the above example, will provide for relative font sizes. As an alternative the font sizes may be defined by their point size, size="10pt". text defined in this way will be rendered to the defined size. Some browsers allow the settings of the font size to be used, fonts defined in this way cannot be adjusted.
Notes.
A hexadecimal number is to the power of 16. Rather than counting from 0 to 9 we count from 0 to 15. To represent this we use the numbers 0 to 9 plus the first 6 characters of the alphabet. Thus the value 12 (decimal) is equivelent to C (hexadecimal).
NAT July 2005 (Revised)
|
This article viewed: 1073 times |
Back |
Copyright © 2004-2007 Janet Systems Ltd.