Sunday, October 30, 2011

HTML 4.01 / XHTML 1.0 Reference

Learn HTML.With HTML you can create your own Web site. This tutorial teaches you everything about HTML. This HTML tutorial contains hundreds of HTML examples. HTML is easy to learn - You will enjoy it.     


                
                                          Ordered Alphabetically

                 DTD: indicates in which HTML 4.01 / XHTML 1.0 DTD the tag is allowed. S=Strict, T=Transitional, and F=Frameset
   Tag            Description+ DTD
  1. <!--...-->     Defines a comment     STF
  2. <!DOCTYPE>      Defines the document type     STF
  3. <a>     Defines an anchor     STF
  4. <abbr>     Defines an abbreviation     STF
  5. <acronym>     Defines an acronym     STF
  6. <address>     Defines contact information for the author/owner of a document     STF
  7. <applet>     Deprecated. Defines an embedded applet     TF
  8. <area />     Defines an area inside an image-map     STF
  9. <b>     Defines bold text     STF
  10. <base />     Defines a default address or a default target for all links on a page     STF
  11. <basefont />     Deprecated. Defines a default font, color, or size for the text in a page     TF
  12. <bdo>     Defines the text direction     STF
  13. <big>     Defines big text     STF
  14. <blockquote>     Defines a long quotation     STF
  15. <body>     Defines the document's body     STF
  16. <br />     Defines a single line break     STF
  17. <button>     Defines a push button     STF
  18. <caption>     Defines a table caption     STF
  19. <center>     Deprecated. Defines centered text     TF
  20. <cite>     Defines a citation     STF
  21. <code>     Defines computer code text     STF
  22. <col />     Defines attribute values for one or more columns in a table      STF
  23. <colgroup>     Defines a group of columns in a table for formatting     STF
  24. <dd>     Defines a description of a term in a definition list     STF
  25. <del>     Defines deleted text     STF
  26. <dfn>     Defines a definition term     STF
  27. <dir>     Deprecated. Defines a directory list     TF
  28. <div>     Defines a section in a document     STF
  29. <dl>     Defines a definition list     STF
  30. <dt>     Defines a term (an item) in a definition list     STF
  31. <em>     Defines emphasized text      STF
  32. <fieldset>     Defines a border around elements in a form     STF
  33. <font>     Deprecated. Defines font, color, and size for text     TF
  34. <form>     Defines an HTML form for user input     STF
  35. <frame />     Defines a window (a frame) in a frameset     F
  36. <frameset>     Defines a set of frames     F
  37. <h1> to <h6>     Defines HTML headings     STF
  38. <head>     Defines information about the document     STF
  39. <hr />     Defines a horizontal line     STF
  40. <html>     Defines an HTML document     STF
  41. <i>     Defines italic text     STF
  42. <iframe>     Defines an inline frame     TF
  43. <img />     Defines an image     STF
  44. <input />     Defines an input control     STF
  45. <ins>     Defines inserted text     STF
  46. <isindex>     Deprecated. Defines a searchable index related to a document     TF
  47. <kbd>     Defines keyboard text     STF
  48. <label>     Defines a label for an input element     STF
  49. <legend>     Defines a caption for a fieldset element     STF
  50. <li>     Defines a list item     STF
  51. <link />     Defines the relationship between a document and an external resource     STF
  52. <map>     Defines an image-map      STF
  53. <menu>     Deprecated. Defines a menu list     TF
  54. <meta />     Defines metadata about an HTML document     STF
  55. <noframes>     Defines an alternate content for users that do not support frames     TF
  56. <noscript>     Defines an alternate content for users that do not support client-side scripts     STF
  57. <object>     Defines an embedded object     STF
  58. <ol>     Defines an ordered list     STF
  59. <optgroup>     Defines a group of related options in a select list     STF
  60. <option>     Defines an option in a select list     STF
  61. <p>     Defines a paragraph     STF
  62. <param />     Defines a parameter for an object     STF
  63. <pre>     Defines preformatted text     STF
  64. <q>     Defines a short quotation     STF
  65. <s>     Deprecated. Defines strikethrough text     TF
  66. <samp>     Defines sample computer code     STF
  67. <script>     Defines a client-side script     STF
  68. <select>     Defines a select list (drop-down list)     STF
  69. <small>     Defines small text     STF
  70. <span>     Defines a section in a document     STF
  71. <strike>     Deprecated. Defines strikethrough text     TF
  72. <strong>     Defines strong text     STF
  73. <style>     Defines style information for a document     STF
  74. <sub>     Defines subscripted text     STF
  75. <sup>     Defines superscripted text     STF
  76. <table>     Defines a table     STF
  77. <tbody>     Groups the body content in a table     STF
  78. <td>     Defines a cell in a table     STF
  79. <textarea>     Defines a multi-line text input control     STF
  80. <tfoot>     Groups the footer content in a table     STF
  81. <th>     Defines a header cell in a table     STF
  82. <thead>     Groups the header content in a table     STF
  83. <title>     Defines the title of a document     STF
  84. <tr>     Defines a row in a table     STF
  85. <tt>     Defines teletype text     STF
  86. <u>     Deprecated. Defines underlined text     TF
  87. <ul>     Defines an unordered list     STF
  88. <var>     Defines a variable part of a text     STF
  89. <xmp>     Deprecated. Defines preformatted text      

                             

             Ordered by Function

                DTD: indicates in which HTML 4.01 / XHTML 1.0 DTD the tag is allowed. S=Strict, T=Transitional, and F=Frameset
      Tag                                Description+DTD           
  1. <!DOCTYPE>      Defines the document type     STF
  2. <html>     Defines an HTML document     STF
  3. <body>     Defines the document's body     STF
  4. <h1> to <h6>     Defines HTML headings     STF
  5. <p>     Defines a paragraph     STF
  6. <br />     Inserts a single line break     STF
  7. <hr />     Defines a horizontal line     STF
  8. <!--...-->     Defines a comment     STF
  9. Formatting            
  10. <acronym>     Defines an acronym     STF
  11. <abbr>     Defines an abbreviation     STF
  12. <address>     Defines contact information for the author/owner of a document     STF
  13. <b>     Defines bold text     STF
  14. <bdo>     Defines the text direction     STF
  15. <big>     Defines big text     STF
  16. <blockquote>     Defines a long quotation     STF
  17. <center>     Deprecated. Defines centered text     TF
  18. <cite>     Defines a citation     STF
  19. <code>     Defines computer code text     STF
  20. <del>     Defines deleted text     STF
  21. <dfn>     Defines a definition term     STF
  22. <em>     Defines emphasized text      STF
  23. <font>     Deprecated. Defines font, color, and size for text     TF
  24. <i>     Defines italic text     STF
  25. <ins>     Defines inserted text     STF
  26. <kbd>     Defines keyboard text     STF
  27. <pre>     Defines preformatted text     STF
  28. <q>     Defines a short quotation     STF
  29. <s>     Deprecated. Defines strikethrough text     TF
  30. <samp>     Defines sample computer code     STF
  31. <small>     Defines small text     STF
  32. <strike>     Deprecated. Defines strikethrough text     TF
  33. <strong>     Defines strong text     STF
  34. <sub>     Defines subscripted text     STF
  35. <sup>     Defines superscripted text     STF
  36. <tt>     Defines teletype text     STF
  37. <u>     Deprecated. Defines underlined text     TF
  38. <var>     Defines a variable part of a text     STF
  39. <xmp>     Deprecated. Defines preformatted text      
  40. Forms            
  41. <form>     Defines an HTML form for user input     STF
  42. <input />     Defines an input control     STF
  43. <textarea>     Defines a multi-line text input control     STF
  44. <button>     Defines a push button     STF
  45. <select>     Defines a select list (drop-down list)     STF
  46. <optgroup>     Defines a group of related options in a select list     STF
  47. <option>     Defines an option in a select list     STF
  48. <label>     Defines a label for an input element     STF
  49. <fieldset>     Defines a border around elements in a form     STF
  50. <legend>     Defines a caption for a fieldset element     STF
  51. <isindex>     Deprecated. Defines a searchable index related to a document     TF
  52. Frames            
  53. <frame />     Defines a window (a frame) in a frameset     F
  54. <frameset>     Defines a set of frames     F
  55. <noframes>     Defines an alternate content for users that do not support frames     TF
  56. <iframe>     Defines an inline frame     TF
  57. Images            
  58. <img />     Defines an image     STF
  59. <map>     Defines an image-map      STF
  60. <area />     Defines an area inside an image-map     STF
  61. Links            
  62. <a>     Defines an anchor     STF
  63. <link />     Defines the relationship between a document and an external resource     STF
  64. Lists            
  65. <ul>     Defines an unordered list     STF
  66. <ol>     Defines an ordered list     STF
  67. <li>     Defines a list item     STF
  68. <dir>     Deprecated. Defines a directory list     TF
  69. <dl>     Defines a definition list     STF
  70. <dt>     Defines a term (an item) in a definition list     STF
  71. <dd>     Defines a description of a term in a definition list     STF
  72. <menu>     Deprecated. Defines a menu list     TF
  73. Tables            
  74. <table>     Defines a table     STF
  75. <caption>     Defines a table caption     STF
  76. <th>     Defines a header cell in a table     STF
  77. <tr>     Defines a row in a table     STF
  78. <td>     Defines a cell in a table     STF
  79. <thead>     Groups the header content in a table     STF
  80. <tbody>     Groups the body content in a table     STF
  81. <tfoot>     Groups the footer content in a table     STF
  82. <col />     Defines attribute values for one or more columns in a table     STF
  83. <colgroup>     Defines a group of columns in a table for formatting     STF
  84. Styles            
  85. <style>     Defines style information for a document     STF
  86. <div>     Defines a section in a document     STF
  87. <span>     Defines a section in a document     STF
  88. Meta Info            
  89. <head>     Defines information about the document     STF
  90. <title>     Defines the document title     STF
  91. <meta>     Defines metadata about an HTML document     STF
  92. <base />     Defines a default address or a default target for all links on a page     STF
  93. <basefont />     Deprecated. Defines a default font, color, or size for the text in a page     TF
  94. Programming            
  95. <script>     Defines a client-side script     STF
  96. <noscript>     Defines an alternate content for users that do not support client-side scripts     STF
  97. <applet>     Deprecated. Defines an embedded applet     TF
  98. <object>     Defines an embedded object     STF
  99. <param />     Defines a parameter for an object     STF

 

Core Attributes

Not valid in base, head, html, meta, param, script, style, and title elements.
Attribute Value Description
class classname Specifies a classname for an element
id id Specifies a unique id for an element
style style_definition Specifies an inline style for an element
title text  Specifies extra information about an element


Language Attributes

Not valid in base, br, frame, frameset, hr, iframe, param, and script elements.
Attribute Value Description
dir ltr
rtl
Specifies the text direction for the content in an element
lang language_code Specifies a language code for the content in an element. 
xml:lang language_code Specifies a language code for the content in an element, in XHTML documents. 


Keyboard Attributes

Attribute Value Description
accesskey character Specifies a keyboard shortcut to access an element
tabindex number Specifies the tab order of an element


Standard Event Attributes

HTML 4 added the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on an element.


<body> and <frameset> Events

The two attributes below can only be used in <body> or <frameset>:
Attribute Value Description
onload script Script to be run when a document load
onunload script Script to be run when a document unload


Form Events

The attributes below can be used in form elements:
Attribute Value Description
onblur script Script to be run when an element loses focus
onchange script Script to be run when an element changes
onfocus script Script to be run when an element gets focus
onreset script Script to be run when a form is reset
onselect script Script to be run when an element is selected
onsubmit script Script to be run when a form is submitted


Image Events

The attribute below can be used with the img element:
Attribute Value Description
onabort script Script to be run when loading of an image is interrupted


Keyboard Events

Valid in all elements except base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title.
Attribute Value Description
onkeydown script Script to be run when a key is pressed
onkeypress script Script to be run when a key is pressed and released
onkeyup script Script to be run when a key is released


Mouse Events

Valid in all elements except base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title.
Attribute Value Description
onclick script Script to be run on a mouse click
ondblclick script Script to be run on a mouse double-click
onmousedown script Script to be run when mouse button is pressed
onmousemove script Script to be run when mouse pointer moves
onmouseout script Script to be run when mouse pointer moves out of an element
onmouseover script Script to be run when mouse pointer moves over an element
onmouseup script Script to be run when mouse button is released
 
                                 

HTML Elements and Valid Doctypes


HTML/XHTML Elements and Valid DTDs

The following table lists all HTML/XHTML elements, and defines which doctype declarations (DTDs) each element appear in.
Tag HTML 4.01 / XHTML 1.0 XHTML 1.1
Transitional Strict Frameset
<a> Yes Yes Yes Yes
<abbr> Yes Yes Yes Yes
<acronym> Yes Yes Yes Yes
<address> Yes Yes Yes Yes
<applet> Yes No Yes No
<area /> Yes Yes Yes No
<b> Yes Yes Yes Yes
<base /> Yes Yes Yes Yes
<basefont /> Yes No Yes No
<bdo> Yes Yes Yes No
<big> Yes Yes Yes Yes
<blockquote> Yes Yes Yes Yes
<body> Yes Yes Yes Yes
<br /> Yes Yes Yes Yes
<button> Yes Yes Yes Yes
<caption> Yes Yes Yes Yes
<center> Yes No Yes No
<cite> Yes Yes Yes Yes
<code> Yes Yes Yes Yes
<col /> Yes Yes Yes No
<colgroup> Yes Yes Yes No
<dd> Yes Yes Yes Yes
<del> Yes Yes Yes No
<dfn> Yes Yes Yes Yes
<dir> Yes No Yes No
<div> Yes Yes Yes Yes
<dl> Yes Yes Yes Yes
<dt> Yes Yes Yes Yes
<em> Yes Yes Yes Yes
<fieldset> Yes Yes Yes Yes
<font> Yes No Yes No
<form> Yes Yes Yes Yes
<frame /> No No Yes No
<frameset> No No Yes No
<h1> to <h6> Yes Yes Yes Yes
<head> Yes Yes Yes Yes
<hr /> Yes Yes Yes Yes
<html> Yes Yes Yes Yes
<i> Yes Yes Yes Yes
<iframe> Yes No Yes No
<img /> Yes Yes Yes Yes
<input /> Yes Yes Yes Yes
<ins> Yes Yes Yes No
<isindex> Yes No Yes No
<kbd> Yes Yes Yes Yes
<label> Yes Yes Yes Yes
<legend> Yes Yes Yes Yes
<li> Yes Yes Yes Yes
<link /> Yes Yes Yes Yes
<map> Yes Yes Yes No
<menu> Yes No Yes No
<meta /> Yes Yes Yes Yes
<noframes> Yes No Yes No
<noscript> Yes Yes Yes Yes
<object> Yes Yes Yes Yes
<ol> Yes Yes Yes Yes
<optgroup> Yes Yes Yes Yes
<option> Yes Yes Yes Yes
<p> Yes Yes Yes Yes
<param /> Yes Yes Yes Yes
<pre> Yes Yes Yes Yes
<q> Yes Yes Yes Yes
<s> Yes No Yes No
<samp> Yes Yes Yes Yes
<script> Yes Yes Yes Yes
<select> Yes Yes Yes Yes
<small> Yes Yes Yes Yes
<span> Yes Yes Yes Yes
<strike> Yes No Yes No
<strong> Yes Yes Yes Yes
<style> Yes Yes Yes Yes
<sub> Yes Yes Yes Yes
<sup> Yes Yes Yes Yes
<table> Yes Yes Yes Yes
<tbody> Yes Yes Yes No
<td> Yes Yes Yes Yes
<textarea> Yes Yes Yes Yes
<tfoot> Yes Yes Yes No
<th> Yes Yes Yes Yes
<thead> Yes Yes Yes No
<title> Yes Yes Yes Yes
<tr> Yes Yes Yes Yes
<tt> Yes Yes Yes Yes
<u> Yes No Yes No
<ul> Yes Yes Yes Yes
<var> Yes Yes Yes Yes 

    1 comment:

    Online visitors counter users online