HTML Basic Tag List, pg. 1
(all tags come in pairs unless they're marked with an asterisk; these have to be closed with a space and a backslash [ex. <br />])

<body> is an example of an HTML tag. The term "tag" includes the opening and closing angle brackets as well as the name between them. Names should always be written in lowercase.

Tags can be nested. According to the XHTML specification, the nesting has to be done in a certain order. This: <b><i>hello</i></b> is correct; this: <b><i>hello</b></i> is not. If a tag is on the outside in the beginning, it must be on the outside at the end. Insert the tag pairs before adding text to prevent nesting errors.

All tags have a closing tag unless they have an asterisk by them on page 1 or page 2 of this list. The closing tag is the same as the original tag but with a backslash added. Example: </body>. The text goes between the two tags. For tags without a closing tag, only one tag is used and a backslash is added. Example: <br />. This is also an XHTML specification.

Nearly every tag has attributes, or settings that are usually optional. All attributes are written in lowercase and are written like this: attributeType="attributeName".

Webpages should always be previewed with Firefox, Netscape, or Opera during development as Internet Explorer doesn't interpret web specifications like it should, especially if you are coding with Cascading StyleSheets (CSS). But don't forget to look at the webpage with IE to fix any really bad problems since majority of web users still use that browser. Unfortunately, IE fixes have been known to cause problems with every other browser.

Required Page Tags
  • <html> - Defines an HTML page
  • <head> - Defines the heading of a webpage
  • <title> - Sets the title of the webpage; not required but useful
  • <body> - Defines what's visible to the public
<head><title>The webpage title</title></head>

What visitors will see in their browser

Page Formatting Tags
  • <br>* - Inserts a linebreak
  • <center> - Centers text
  • <hr>* - Inserts a horizonal line to divide up the page
  • <p> - Defines a paragraph that will add doublespacing before and after it
Text Formatting Tags
  • <font> - Sets the font face, size, and color
    • color: color names, hexadecimal digits, RGB values
    • face: font family (Arial, Times New Roman, etc.)
    • size: values from 1-7, with 1 being the smallest
<font face="Arial" size="3" color="blue">
example text
  • <b> or <strong> - Makes text bold
  • <i> or <em> - Italicizes text
  • <u> - Underlines text
  • <strike> or <s> or <del> - Crosses out text
  • <h1> through <h6> - Heading text; <h1> is the largest, <h6> is the smallest
Table Tags
  • <table> - Defines a table; these are primarily used for page layouts
    • cellpadding: sets the amount of blank space in the table cells
    • cellspacing: sets the amount of blank space between the table cells
    • border: sets the thickness (and visibility) of the table border
    • width: sets the width of the table in pixels or percentage
    • align: sets the table alignment (left, right, center)
    • bgcolor: sets the background color of the table
  • <th> - Defines a bolded table heading; must be used right after <table>
    • align: sets the text alignment (left, right, center, justify, or char)
    • char: sets which character to base the text alignment on
    • colspan: sets how many table columns this cell should span
    • rowspan: sets how many table rows this cell should span
    • height: sets the height of the cell
    • valign: sets the vertical text alignment of the cell (top, bottom, middle)
  • <tr> - Defines a table row; can use the align, bgcolor, and valign attributes
  • <td> - Defines a table cell; can use the align, bgcolor, valign, height, width, colspan, and rowspan attributes
  • <caption> - Adds a caption to a table; must be used right after <table>
    • align: sets the text alignment (left, right, top, bottom)
<table width="500" align="center" border="0">
<tr><td>cell #1</td>
<td>cell #1</td></tr>