|
|
HTML Formatting Codes
|
Font size |
font appearance |
lists |
text breaks|
other formatting |
special characters|
color
Font size: Two ways to
control
- Through the header command
- <H1>The largest head
</H1>
- <H6>The smallest
head</H6>
- Through the font
size command
- <font size=+1> one
size larger than base font </font>
- <font size=-1> one size smaller than base
font</font>
- Font sizes range from -6 to +6
Font appearance: italics and
boldface
- Italics
- Old style <em>
means emphasis</em>
- New style <i>
means italics</i>
- Boldface
- Old style <strong>
means strong emphasis</strong>
- New
style <b> means bold
</b>
Lists
- Three kinds:
- ordered
- unordered
- definition
- Lists use a
combination of paired and unpaired codes
(list item [<li>] codes can be paired or unpaired)
- Unordered
- <UL>turns on the
list feature
- <LI>list
item
- <LI>another list
item
- </UL>turns off the list
feature
- An
example
- Ordered
- <OL>turns on the
list feature
- <LI>list
item
- <LI>another list
item
- </OL>turns off the list
feature
- An
example
- Definition
list
- <DL>turns on the list
feature
- <DT>definition
term
- <DD>definition
data
- <DT>another definition
term
- <DD>more definition
data
- </DL>turns off list
feature
- An
example
Text Breaks
- These don't require pairs
- Line
break <br>
- Paragraph break
<p>
--can be paired or unpaired;
paragraph alignment can be controlled
in opening
code, e.g.,
<p align=center>
if a pair of codes is used
- Horizontal rule
<hr>
Other
- <center>All text inside this code will be
centered horizontally on the page</center>
- <blockquote>All text inside this code will be indented from
the left and right margins</blockquote>
- Tables and frames are beyond the scope
of this tutorial. You can find documentation for both of these at the
Netscape site.
(
Tables and
Frames )
Special
characters
- Codes that refer to
characters' positions in the ISOcharacter set allow you to use characters
from foreign languages, copyright symbols, and other nonstandard
characters.
- All
codes start with an ampersand (&) and end with a semicolon -- with a
numerical or an intuitive ("entity") reference in between --
e.g., the copyright symbol(©) is ©
-
Here is a list of those
characters and their codes
- There are four characters with special
meanings in HTML code (double quotation mark, ampersand, greater-than sign
and lesser-than sign). To display these characters, you must use
the special code.
Color
- Colors are controlled through special codes. Set the background
color, body text, and link colors directly after the
<body>tag:
<BODY BGGOLOR="#nnnnnn"
text="#nnnnnn" link="#n
nnnnn"vlink="#nnnnnn"
alink="#nnnnnn"> - link=a link
in the text
- vlink=a link which has been
followed
- alink=links that are being clicked
on - they will flash the color you specify, but only
momentarily
- nnnnnn=the color's hex code. Here
is a swatchchart
for colors
that work well on virtually all platforms and monitors, showing their
hex codes and RGB (red/green/blue) values (216 kb file)
Get cheat
sheet for this page
Back to rocket science
This page maintained by Laura Blanchard,lblancha@pobox.upenn.edu