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