HTML CHEAT SHEET

SYNTAX
Basic
HTML: <tag></tagclose> or <tag>
XHTML: <tag></tagclose> or <tag />
With an Attribute
HTML: <tag attribute="?">
XHTML: <tag attribute="?" / >
BASIC
<body> the visible portion of the page
<head> portion not displayed on the page
<html> creates a html page
<title> shows the page name in the title bar
LINKS
<img src="URL">* displays an image
<a href="#?">* link to anchor in current document
<a href="URL">* link to another document
<a href="URL#?">* link to anchor in another document
<a href="mailto:EMAIL">* email link
STRUCTURE
<br>* line break
<code> source code listing
<div> Formats structure or block of text
<em> italic text
<h1>...<h6> page headings from largest to smallest
<hr> horizontal rule
<p> paragraph
<pre> preformatted text
<span> Inline formatting
<strong> bold text
<sub> subscript text
<sup> superscript text
FRAMES
<frame> defines a single frame
<frameset> frame document
<iframe> inline frame
HEAD
<link rel="stylesheet" href="?" type="text/css"> * external CSS link
<script language="Javascript" type="text/javascript"> embedded javascript
<meta http-equiv="content-type" content="?"; charset="?">* meta information
TABLES
<caption> table caption
<table> defines a table
<tbody> body section of the table
<td> table cell
<td colspan="?"> number of columns cell spans
<td rowspan="?"> number of rows cell should spans
<tfoot> footer section of the table
<th> table header cells
<th colspan="?"> number of columns table header cell spans
<thead> the header section of the table
<tr> table row
LISTS
<dd> definition
<dl> definition list
<dt> definition term
<li> item in a list
<ol> ordered list
<ul> unordered list
FORMS
<form> defines a form
<fieldset> group of related form items
<input type="?">* form element (see input types at right)
<option> menu item in a select box
<select> drop-down list
<textarea> multi-row text area
SPECIAL CHARACTERS
&nbsp; non-breaking space
&quot; quotation mark
&amp; ampersand
&lt; less than sign
&gt; greater than sign
* Note: Does not require a closing tag

Template


<html>
<head>
<title></title>
Meta Tags
CSS
JavaScript

</head>
<body>
Content
</body>
</html>

CSS Media


all
handheld
print
projection
screen

Meta Types


http-equiv
name

Lists


<ol>
<li>
</li>
</ol>

<ul>
<li>
</li>
</ul>

Table


<table>

<thead>
<tr>
<th>
</th>
</tr>
</thead>

<tbody>
<tr>
<td>
</td>
</tr>
</tbody>

<tfoot>
<tr>
<td>
</td>
</tr>
</tfoot>

</table>

Input Types


button
checkbox
file
hidden
image
password
radio
reset
submit
text