You are on page 1of 3

Reference HTML Cheat Sheet

Basic Tags Sets size of font, from 1 to 7)

<html></html> <font color=?></font>
Creates an HTML document Sets font color, using name or hex value
<head></head> Links
Sets off the title and other information that <a href="URL"></a>
isn't displayed on the Web page itself Creates a hyperlink
<body></body> <a href="mailto:EMAIL"></a>
Sets off the visible portion of the document Creates a mailto link
Header Tags <a name="NAME"></a>
<title></title> Creates a target location within a document
Puts the name of the document in the title <a href="#NAME"></a>
bar Links to that target location from elsewhere
Body Attributes in the document
<body bgcolor=?> Formatting
Sets the background color, using name or <p></p>
hex value Creates a new paragraph
<body text=?> <p align=?>
Sets the text color, using name or hex value Aligns a paragraph to the left, right, or
<body link=?> center
Sets the color of links, using name or hex <br>
value Inserts a line break
<body vlink=?> <blockquote>
Sets the color of followed links, using name </blockquote>
or hex value Indents text from both sides
<body alink=?> <dl></dl>
Sets the color of links on click Creates a definition list
Text Tags <dt>
<pre></pre> Precedes each definition term
Creates preformatted text <dd>
<hl></hl> Precedes each definition
Creates the largest headline <ol></ol>
<h6></h6> Creates a numbered list
Creates the smallest headline <li></li>
<b></b> Precedes each list item, and adds a number
Creates bold text <ul></ul>
<i></i> Creates a bulleted list
Creates italic text <div align=?>
<tt></tt> A generic tag used to format large blocks of
Creates teletype, or typewriter-style text HTML, also used for style sheets
Creates a citation, usually italic
<em></em> Graphical Elements
Emphasizes a word (with italic or bold) <img src="name">
<strong></strong> Adds an image
Emphasizes a word (with italic or bold) <img src="name" align=?>
<font size=?></font> Aligns an image: left, right, center; bottom,
top, middle <frameset></frameset>
<img src="name" border=?> Replaces the <body> tag in a frames
Sets size of border around an image document; can also be nested in other
<hr> framesets
Inserts a horizontal rule <frameset rows="value,value">
<hr size=?> Defines the rows within a frameset, using
Sets size (height) of rule number in pixels, or percentage of w idth
<hr width=?> <frameset cols="value,value">
Sets width of rule, in percentage or absolute Defines the columns within a frameset,
value using number in pixels, or percentage of
<hr noshade> width
Creates a rule without a shadow <frame>
Defines a single frame — or region — within
a frameset
Creates a table
Defines what will appear on browsers that
don't support frames
Sets off each row in a table
Frames Attributes
<frame src="URL">
Sets off each cell in a row
Specifies which HTML document should be
Sets off the table header (a normal cell with
<frame name="name">
bold, centered text)
Names the frame, or region, so it may be
Table Attributes
targeted by other frames
<table border=#>
<frame marginwidth=#>
Sets width of border around table cells
Defines the left and right margins for the
<table cellspacing=#> frame; must be equal to or greater than 1
Sets amount of space between table cells
<frame marginheight=#>
<table cellpadding=#> Defines the top and bottom margins for the
Sets amount of space between a cell's frame; must be equal to or greater than 1
border and its contents
<frame scrolling=VALUE>
<table width=# or %> Sets whether the frame has a scrollbar;
Sets width of table — in pixels or as a value may equal "yes," "no," or "auto." The
percentage of document width default, as in ordinary documents, is auto.
<tr align=?> or <td align=?> <frame noresize>
Sets alignment for cell(s) (left, center, or Prevents the user from resizing a frame
<tr valign=?> or <td valign=?>
Sets vertical alignment for cell(s) (top,
middle, or bottom)
<td colspan=#>
Sets number of columns a cell should span Forms
<td rowspan=#> For functional forms, you'll have to run a
Sets number of rows a cell should span CGI script. The HTML just creates the
(default=1) appearance of a form.
<td nowrap> <form></form>
Prevents the lines within a cell from being Creates all forms
broken to fit <select multiple name="NAME" size=?
Frames ></select>
Creates a scrolling menu. Size sets the
number of menu items visible before you Creates a checkbox. Text follows tag.
need to scroll. <input type="radio" name="NAME"
<option> value="x">
Sets off each menu item Creates a radio button. Text follows tag
<select name="NAME"></select> <input type=text name="foo" size=20>
Creates a pull down menu Creates a one-line text area. Size sets
<option> length, in characters.
Sets off each menu item <input type="submit" value="NAME">
<textarea name="NAME" cols=40 Creates a Submit button
rows=8></textarea> <input type="image" border=0
Creates a text box area. Columns set the name="NAME" src="name.gif">
width; rows set the height. Creates a Submit button using an image
<input type="checkbox" name="NAME"> <input type="reset">
Creates a Reset button