HTML Text Formatting
This page shows tags that are used to format HTML text and provides a description of what they do.
There are many tags used to format text. They are listed below:
- <b>..</b> - Sets bold text.
- <big>..</big> - Sets larger than normal text.
- <em>..</em> - Sets text in italics and denotes emphasis.
- <i>..</i> - Sets text in italics.
- <small>..</small> - Makes text smaller than normal.
- <strike>..</strike> - Draws a line through the text as a "strikeout".
- <strong>..</strong> - Same as bold but denotes strong emphasis.
- <super>..</super> -Superscript.
- <tt>..</tt> - Monospaced typewriter font.
- <u>..</u> - Underlined text.
- <var>..</var> - Mark a variable.
Examples
Here's the HTML code:
This is an example of the <b><b> tag </b>.<br>
This is an example of the <big><big> tag</big>.<br>
This is an example of the <em><em> tag</em><br>
This is an example of the <i><i> tag</i>.<br>
This is an example of the <small><small> tag</small>.<br>
This is an example of the <strike><strike> tag</strike>.<br>
This is an example of the <strong><strong> tag<strong>.<br>
This is an example of the <sup><sup> tag<sup>.<br>
This is an example of the <sub><sub> tag<sub>.<br>
This is an example of the <tt><tt> tag<tt>.<br>
This is an example of the <u><u> tag</u><br>
This is an example of the <var><var> tag</var><br>
Here's how it looks:
|
|
This is an example of the <b> tag.
This is an example of the <big> tag.
This is an example of the <em> tag.
This is an example of the <i> tag.
This is an example of the <small> tag.
This is an example of the <strike> tag.
This is an example of the <strong> tag.
This is an example of the <sup> tag.
This is an example of the <sub> tag.
This is an example of the <TT> tag.
This is an example of the <u> tag.
This is an example of the <var> tag.
Other tags associated with text are:
- ABBREV - Denotes an abbreviation
- ACRONYM
- AU - Author
- CODE - Denotes program code and should be set in the same format as the PRE tag, but does not work either with all browsers or all HTML versions.
- DEL - Denotes deleted text.
- DFN - Denotes the definition of a term
- INS - Denotes inserted text
- KBD - Text to be typed at the keyboard, such as a computer command. The test is displayed in a mono spaced format.
- PERSON
- Q - Quotation.
- SAMP - Denotes sample text.
Each of these tags require an ending tag.
The FONT tag
The font element is being depreciated and replaced by style sheet attributes. The <FONT> element is used to set a section of text with a specific font. It uses the <FONT> tag to begin and the </FONT> for the end tag.
FONT Attributes and Tags
- <FONT> - Begins the FONT element.
- SIZE="4" - Sets the font size using a value, between 1 and 7. The default value is 3. It can be specified with a "+n" value to set the size relative to the current size.
- COLOR="blue" - Sets the text color.
- FACE="roman" - The font name to be used. If there is more than one font name separated by commas the first font that can be found is used.
- </FONT> - Ends the FONT element.
- <BASEFONT> - Used to set the default font size on the current page.
- SIZE="2" - Specifies default font size with a value between 1 and 7.
|