GeoffKnagge.com

Headings

This is probably the first text formatting that you'll use. The <H#> </H#> pair are generally used for headings, where # is the size 1-6. 1 is the largest, 6 the smallest. A new line is usually started after each </H#>, however this was avoided in the following output example by using a table.
Example use : <H2>Headings</H2> produced the above heading

Size 1

Size 2

Size 3

Size 4

Size 5
Size 6

Formatting Normal Text

All of the following can be used in virtually any combination, and also within headings and links :

Fonts : <font face="font name(s)" size="s" color="#rrggbb"> </font> allows you to select a custom font for the enclosed text. s is a size number 0-7, or +1 to +7 which allows you to set how many sizes above the current size to use. Unlike headings, a higher number represents a larger size. rrggbb is the hexadecimal red, green and blue values for the text color. the face parameter allows you to list the fonts, in order or preference and seperated by commas, which you would like to use. If none of the given fonts are installed, the default is used.
example: <font face="Alien,Arial,Courier New" size="+1" color="#FF0080"> Test text</font> produces Test text

You can also use the <BASEFONT> tag with the same parameters as for FONT. This changes the characteristics of all following text. Note, however, that FACE and COLOR do not appear to be specified as allowable attributes for BASEFONT in the HTML 3.2 specification.

Pre Formatted Text

<pre width="##"> (text here) </pre>
Displays a fixed width font, as seen here.
The optional width="##" parameter specifies the number of
columns: either 40, 80 or 132. Any carraige returns (ie new
lines) within the HTML document will force new lines to be
displayed.

Note: The following tags should not be used within a block of preformatted text : IMG, BIG, SMALL, SUB, SUP and FONT

Special Characters

If you wish to display a character that is not on the keyboard, you can use &#?;, where ? is a decimal number, or a hexadecimal number with a H immediately following. The number represents the number value of the character within a character set.

There are also a few special & codes:
  • &lt; : displays the less than sign
  • &gt;: displays the greater than sign
  • &amp;: displays the & symbol
  • &shy;: soft hyphen - indicates where a line break is permitted.
  • &quot;: displays quotation marks (")

Character Formatting

NameTags usedDescription / Example
Blink <Blink> </Blink> produces text which blinks
Bold <B> </B>
<STRONG> </STRONG>
produces text like this
Italics <i> </i> or
<em> </em>
produces text like this
Underline <u> </u> makes everything underlined
Strike-Through<s> </s>or
<strike> </strike>
makes crossed out text
Subscript<sub> </sub> produces text in subscript form
Superscript<sup> </sup> produces text in superscript form

Paragraph Formatting

NameTags usedDescription / Example
Blockquote <blockquote cite="address of source"> </blockquote> Used for
quoting text. As you can see, it also indents!

Break <br> Linebreak : starts a new line. There is no closing tag.
Center <center></center>
Centres lines of text in an area. Watch that American spelling!

Paragraph <P Align="?"> </P> Forces a new paragraph. Alignment can be left, right or center.
No Breaks <nobr> </nobr> Disallows taking a new line if the text is too wide for the window
Word Break <wbr> For use within a NOBR section, this marks where a line break is allowed if needed, but it does not force one.


Miscellaneous

The following are a few extra tags that exist... most of them are duplicates of others or have little point...
NameTags usedDescription / Example
Address <address> </address>
intended for display of addresses

Big <big> </big> Displays text in a bigger size
Citation <cite> </cite> Basically QUOTE without the indenting
Code <code> </code> Intended for display of program code
Keyboard <kbd> </kbd> Represents text input from a keyboard
Sample<samp> </samp> Displays text in a fixed spaced font
Smaller size : <small> </small> Displays text in a smaller size
Teletype <tt> </tt> displays a fixed width font
Variables <var> </var> Used when displaying variable names
XMP <xmp> </xmp> This is nolonger part of the HTML specification, but had the same effect as <PRE>
(C)opyright, Geoff Knagge.
Continued use of this site indicates your agreement to the Conditions of use and Privacy Policy.