spacer

HTML Font Size Codes

 
<font size="font size">...</font>
Here's a rundown on all the various HTML font size codes you can use to make text bigger or smaller on your web pages.

First of all, you can designate the text size on your web page (or even your MySpace page) using the 'size' attribute in the HTML font element code. If no size is defined for text on a web page then the web browser will display the text at size 3.

The value that you enter for the size attribute is a number representing any one of seven different relative sizes. These number 1 through 7 respectively. These are the results you will get when specifying the size attribute:

This is Size 1.

This is Size 2.

This is Size 3.

This is Size 4.

This is Size 5.

This is Size 6.

This is Size 7.


To apply your selected font size, simply enter the attribute-value pair:
size="font size"
...into your <font> tag where font size equals any number from 1 to 7.

Example:


<font size="4">Your visible text goes here and will look like this.</font>



Alternatives


Another way of designating your text size is to enter a number from 1 through 4 which either adds or subtracts from your basefont size. In the absence of a basefont declaration, the default basefont is size 3. By entering a value of "+1" for the size attribute you designate your text to be displayed one size bigger which then equates to size 4. Likewise a value of "+2" equates to font size 5. Going in the other direction, a value of "-1" equates to size 2 and "-2" equates to size 1 (basefont size 3 - 2 = font size 1).

Many WSYIWYG editors produce source code using this system of font sizing. This should help explain things if you ever decided to take a peek at the source code while using a WYSIWYG editor and subsequently wondered what all that "+2" and "-1" stuff was about.

Still another way of defining your text size on a web page is to use the big and small font style elements. This system works very similar to the size=±1 system in that using one set of <big>...</big> tags equates to one size bigger while using one set of <small>...</small> tags equates to one size smaller.

Hence, if you were starting from a blank web page with no formatting applied yet (default basefont size 3), the following three examples will produce identical results:


<font size="4">Same as it ever was...</font>



<font size="+1">Same as it ever was...</font>



<big>Same as it ever was...</big>



Nesting a pair of <big>...</big> tags one within the other and using this to format text has the same effect as rendering the text two sizes bigger or, in effect, using the size="+2" attribute-value pair with the font element.

Hence, the following three examples will produce identical results:


<font size="5">Three of a kind all over again.</font>



<font size="+2">Three of a kind all over again.</font>



<big><big>Three of a kind all over again.</big></big>


Many WYSIWYG editors use this big/small font sizing system as well. This is one of the drawbacks of using these 'instant cakemix' web authoring programs. They can at times produce some very bloated and messy source code. Using one of these programs, when the user highlights the text he wants to make really big and then clicks four times on the make-text-bigger button (quite often denoted by an a+ button on the user interface), the resulting source code will look like this:


<big><big><big><big>Your really big text.</big></big></big></big>


This is rendered much easier by simply putting:


<font size="7">Your really big text.</font>



An even more ridiculous scenario is produced when the WYSIWYG user highlights some text he would like to make bigger and then, for example, clicks three times on the make-text-bigger button but then later changes his mind and decides some previously typed text would be better at the original size. So then —often unaware of what he is really creating behind the scenes in the source code— he goes back, highlights that text and clicks three times on the make-text-smaller button producing a bunch of source code that is a complete waste of space:


<big><big><big><small><small><small>No sizing will be applied to this text..</small></small></small> ...while this text will appear at size 6.</big></big></big>


This is exactly the same as simply putting:


No sizing will be applied to this text... <font size="6"> ...while this text will appear at size 6. </font>



Once you've tried to debug a web page stuffed to the gills with this kind of useless source code á la <big> <big> <big> <small> <small> <small> </small> </small> </small> </big> </big> </big> <big> <small> </small> <big> etcetera, ad nauseum, you may give some second thoughts as to how "easy" some WYSIWYG editors really are.

So what size text should you use? This is partly a matter of taste and partly a matter of necessity and can also depend on what font style you use.


Text that is too small can be difficult and sometimes even impossible to read (Arial size="1").


On the other hand, text that is too big can have the effect of 'shouting'. This can turn viewers away from your web page, especially if the whole page is filled with text like this (Arial size="6").


Most web page authors tend to hang around the size 3 - size 5 range for normal reading purposes (depending on the font style) but may increase the font size for headers and titles.


Now let's move on to learning how to set the font style on your web page...


See also: