HTML Cheat Sheet
HTML Cheat Sheet
Basic Tags
<html></html>
Creates an HTML document
<head></head>
Sets off the title & other info that isn't displayed
<body></body>
Sets off the visible portion of the document
<title></title>
Puts name of the document in the title bar; when bookmarking pages, this is
what is bookmarked
<body bgcolor=?></body>
Sets background color, using name or hex value
<body text=?></body>
Sets text color, using name or hex value
<body vlink=?></body>
Sets color of visited links, using name or hex value
<body alink=?></body>
Sets color of active links (while mouse-clicking)
Text Tags
<pre></pre>
Creates preformatted text
<h1></h1>--><h6></h6>
Creates headlines -- H1=largest, H6=smallest
<b></b>
Creates bold text (should use instead)
<i></i>
Creates italicized text (should use <em> instead)
<tt></tt>
Creates typewriter-style text
<cite></cite>
Creates a citation, usually processed in italics
<address></address>
Creates address section, usually processed in italics
<em></em>
Emphasizes a word (usually processed in italics)
<strong></st
rong>
Emphasizes a word (usually processed in bold)
<font size=?></font>
Sets size of font - 1 to 7 (should use CSS instead)
<font color=?></font>
Sets font color (should use CSS instead)
<font font=?></font>
Defines the font used (should use CSS instead)
Links
<a name="NAME"">
Creates a target location within a document
Formatting
<p></p>
Creates a new paragraph
<br>
Inserts a line break (carriage return)
<blockquote></blockquote>
Puts content in a quote - indents text from both sides
<span></span>
Used to format inline content with CSS
Lists
<ul></ul>
Creates an unordered list
<ol start=?></ol>
Creates an ordered list (start=xx, where xx is a counting number)
<li></li>
Encompasses each list item
<dl></dl>
Creates a definition list
<dt></dt>
Precedes eachdefintion term
<dd>
Precedes eachdefintion
<hr>
Inserts a horizontal rule
<hr size=?>
Sets size (height) of horizontal rule
<hr width=?>
Sets width of rule (as a % or absolute pixel length)
<hr noshade>
Creates a horizontal rule without a shadow
<img src="URL"/>
Adds image; it is a separate file located at the URL
Tables (use only for data layout - use CSS for page layout)
<table></table>
Creates a table
<tr></tr>
Sets off each row in a table
<td></td>
Sets off each cell in a row
<th></th>
Sets off the table header (a normal cell with bold, centered text)
<table border=?></table>
Sets the width of the border around table cells
<table cellspacing=?></table>
Sets amount of space between table cells
<table cellpadding=?></table>
Sets amount of space between a cell's border and its contents
<table width=?></table>
Sets width of the table in pixels or as a percentage
<table align=?></table>
Sets alignment for cells within the row (left/center/right)
<tr align=?></tr>
Sets alignment for cells within the row (left/center/right)
<td align=?></td>
Sets alignment for cells (left/center/right)
<tr vanila=?></tr>
Sets vertical alignment for cells within the row (top/middle/bottom)
<td rowspan=?></td>
Sets number of rows a cell should span (default=1)
<td colspan=?></td>
Sets number of columns a cell should span
<td nowrap></td>
Prevents lines within a cell from being broken to fit
<form></form>
Defines a form
<select name=?></select>
Creates a pulldown menu
<option>
Sets off each menu item
<input type="reset"></input>
Creates a reset button
Saidul Islam
@saidul_dev