Syntax | Description |
---|---|
<tag>content</tag> | element |
<tag attribute="value">content</tag> | element with attribute |
<tag attribute="value" attribute="value">content</tag> | element with multiple attributes |
<tag attribute="value" /> | empty element |
<!-- comment --> | comment |
HTML5 | XHTML 1.0 Transitional |
---|---|
<!DOCTYPE html> | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<meta charset="utf-8"> |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
html | document root element (required) | lang="[language code]" | top | head, body |
head | document head (required, not displayed) | html | see below | |
body | document body (required) | html | block |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
title | document title (required) | head | text | |
link | link to external style sheet (or other related document) |
|
head | empty |
style | embedded style sheet |
|
head | text |
script | embedded script |
|
head, body | text |
meta | generic meta information |
|
head | empty |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
p | paragraph | block | inline | |
em | emphasis | inline | inline | |
strong | strong emphasis | inline | inline | |
sup | superscript | inline | inline | |
sub | subscript | inline | inline | |
ins | inserted text |
|
inline/ block |
any |
del | deleted text |
|
inline/ block |
any |
abbr | abbreviation |
|
inline | inline |
acronym | acronym |
|
inline | inline |
span | generic inline element |
|
inline | inline |
br | line break | inline | empty |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
h1 | level one heading (title) | block | inline | |
h2 | level two heading (main section) | block | inline | |
h3 | level three heading (sub-section) |
block | inline | |
h4 | level four heading (sub-sub-section) |
block | inline | |
h5 | level five heading (etc...) | block | inline | |
h6 | level six heading | block | inline | |
div | division, generic block-level element |
|
block | any |
hr | horizontal rule | block | empty |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
ul | unordered (bulleted) list | block | li | |
ol | ordered (numbered) list | start="[number]" (deprecated) | block | li |
li | list item | value="[number]" (deprecated) | ul, ol | any |
dl | definition list | block | dt, dd | |
dt | definition term | dl | inline | |
dd | definition description | dl | any |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
a | link/anchor |
|
inline | inline (no a) |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
img | image |
|
inline | empty |
map | client-side image map |
|
block | area |
area | client-side image map area |
|
map | empty |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
table | table |
|
block | see below |
tr | table row | table, thead, tfoot, tbody | th, td | |
th | table header cell |
|
tr | any |
td | table data cell |
|
tr | any |
caption | table caption | table | inline | |
colgroup | table column group identifier |
|
table | col |
col | table column identifier | table | empty | |
thead | table header row group | table | tr | |
tfoot | table footer row group | table | tr | |
tbody | table body row group | table | tr |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
form | form |
|
block | block (no form) |
label | form field label |
|
inline | inline (no label) |
input type= "text" | text field |
|
inline | empty |
input type= "password" | password field (shows asterisks) |
|
inline | empty |
input type= "checkbox" | checkbox field |
|
inline | empty |
input type= "radio" | radio button field |
|
inline | empty |
input type= "submit" | submit form button |
|
inline | empty |
input type= "reset" | reset form button |
|
inline | empty |
input type= "button" | generic button (for scripts) |
|
inline | empty |
input type= "hidden" | hidden field (for data) |
|
inline | empty |
textarea | multi-line text field |
|
inline | text |
select | list box |
|
inline | option |
option | list box choice |
|
select | text |
button | button |
|
inline/ block |
any (no a, forms, etc) |
fieldset | group of fields | block | any | |
legend | fieldset title | fieldset | inline |
Name | Description | Important Attributes | Level | Contains |
---|---|---|---|---|
object | embedded object |
|
inline/ block |
any |
param | object parameter |
|
object | empty |
iframe | inline frame | src="[url]" | inline/ block |
any |
Character | HTML Entity |
---|---|
less than sign (<) | < |
greater than sign (>) | > |
ampersand (&) | & |
quote (") - required within attribute values only | " |
non-breaking space ( ) | |
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
</head>
<body>
</body>
</html>