2  html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 
   3  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
   4 <html xmlns="http://www.w3.org/1999/xhtml"
 
   5      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 
   6      xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
 
   9   <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
 
  11   <title>XHTML 1.1 Quick Reference by examples</title>
 
  13   <meta name="description" content="XHTML 1.1 Quick Reference by examples" />
 
  14   <meta name="keywords" content="html,xhtml 1.1,tags,elements,reference,examples,css"/>
 
  16   <meta name="copyright" content="Copyright (c) 2009 Antonio Ospite, some rights reserved" />
 
  17   <meta name="author" content="Antonio Ospite"/>
 
  18   <meta name="language" content="en"/>
 
  21   <link type="text/css" rel="stylesheet" media="all" href="style.css" />
 
  24   <style type="text/css">
 
  31 /* Style-able elements are those which have the 'style' attribute */
 
  33 /* Structure module */
 
  35 html {} /* style-able? */
 
  67 /* Hypertext module */
 
  84 /* Presentation module */
 
  98 /* Bidirectional text module */
 
 128 /* Client-side Image Map Module */
 
 134 /* Scripting module */
 
 146 <h1>XHTML 1.1 Quick Reference by examples</h1>
 
 149 This page offers a quick reference by examples of all the elements specified by the <a title="eXtensible
 
 150 Hypertext Markup language 1.1"
 
 151 href="http://www.w3.org/TR/xhtml11/">XHTML 1.1</a> W3C standard.</p>
 
 153 <p>This version of XHTML groups the elements by <a title="XHTML Abstract Modules"
 
 154 href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html">module</a>, and this is how they are presented here,
 
 155 with a very brief description and a section of examples of use.</p>
 
 157 <p>There are already other quick reference pages, like the one on <a title="XHTML Reference" href="http://xhtml.com">xhtml.com</a>, or <a title="XHTML Quick Reference Guide For XHTML 1.1" href="http://engelke.com/xhtmlref/">this one</a> or <a title="XHTML 1.0 reference with examples" href="http://www.zvon.org/xxl/xhtmlReference/Output/index.html">this other one with examples</a>. But this page wants to be a <strong>single-page</strong> brief reference; here it is not explained which attributes an element supports, but that can be seen reading the source code of the examples provided for each element. This page could be used as a summary about XHTML or as a precious tool to design <strong>complete</strong> (wrt. XHTML elements) CSS stylesheets for your XHTML pages, giving a quick glance at the results.</p>
 
 161 <p>The XHTML 1.1 document type is made up of the XHTML <em>modules</em> shown 
 
 162 below. The elements, attributes, and minimal content models associated with 
 
 163 these modules are defined in the <a title="XHTML Modularization"
 
 164   href="http://www.w3.org/TR/xhtml11/references.html#ref_xhtml_modularization">XHTML 
 
 165   Modularization</a> document [<a title="XHTML Modularization"
 
 166 href="http://www.w3.org/TR/xhtml11/references.html#ref_xhtml_modularization">XHTMLMOD</a>]).  
 
 167 The elements are listed here for information purposes, but the definitions in 
 
 168 [<a title="XHTML Modularization" 
 
 169   href="http://www.w3.org/TR/xhtml11/references.html#ref_xhtml_modularization">XHTMLMOD</a>] 
 
 170 should be considered definitive.
 
 171 In  this document, the module names in the list below link into the 
 
 173 the modules within the current version of [<a title="XHTML Modularization" 
 
 174   href="http://www.w3.org/TR/xhtml11/references.html#ref_xhtml_modularization">XHTMLMOD</a>].</p>
 
 177 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_structuremodule">Structure Module</a>*</dt>
 
 179 <dd><code>body</code>, <code>head</code>, <code>html</code>, <code>title</code></dd>
 
 181 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_textmodule">Text Module</a>*</dt>
 
 184 <code>abbr</code>, <code>acronym</code>, <code>address</code>, <code>blockquote</code>, <code>br</code>, <code>cite</code>, <code>code</code>, <code>dfn</code>, <code>div</code>, <code>em</code>, <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code>, <code>kbd</code>, <code>p</code>, <code>pre</code>, <code>q</code>, <code>samp</code>, <code>span</code>, <code>strong</code>, <code>var</code>
 
 189 The minimal content model for this module defines some content sets:
 
 193 <dd><code>h1</code> | <code>h2</code> | <code>h3</code> | <code>h4</code> | <code>h5</code> | <code>h6</code></dd>
 
 197 <dd><code>address</code> | <code>blockquote</code> | <code>div</code> | <code>p</code> | <code>pre</code></dd>
 
 201 <dd><code>abbr</code> | <code>acronym</code> | <code>br</code> | <code>cite</code> | <code>code</code> | <code>dfn</code> | <code>em</code> | <code>kbd</code> | <code>q</code> | <code>samp</code> | <code>code</code> | <code>strong</code> | <code>var</code></dd>
 
 205 <dd><em>Heading</em> | <em>Block</em> | <em>Inline</em></dd>
 
 211 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_hypertextmodule">Hypertext Module</a>*</dt>
 
 216 This module adds the <code>a</code> element to the <em>Inline</em> content set
 
 217 of the <strong>Text Module</strong>
 
 222 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_listmodule">List Module</a>*</dt>
 
 225 <code>dl</code>, <code>dt</code>, <code>dd</code>, <code>ol</code>, <code>ul</code>, <code>li</code>
 
 227   This module also defines the content set <em>List</em> with the minimal content model
 
 228 (<code>dl</code> | <code>ol</code> | <code>ul</code>)+ and adds this set to the <em>Flow</em> content set of the
 
 229 <strong>Text Module</strong>.
 
 233 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_objectmodule">Object Module</a></dt>
 
 236 <code>object</code>, <code>param</code>
 
 238 When this module is used, it adds the <code>object</code> element to the <em>Inline</em> content set
 
 239 of the <strong>Text Module</strong>.
 
 243 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_presentationmodule">Presentation Module</a></dt>
 
 246 <code>b</code>, <code>big</code>, <code>hr</code>, <code>i</code>, <code>small</code>, <code>sub</code>, <code>sup</code>, <code>tt</code>
 
 248 When this module is used, the <code>hr</code> element is added to the
 
 249 <em>Block</em> content set of the <strong>Text Module</strong>. In addition,
 
 250 the <code>b</code>, <code>big</code>, <code>i</code>, <code>small</code>, <code>sub</code>, <code>sup,</code> and <code>tt</code> elements are
 
 251 added to the <em>Inline</em> content set of the <strong>Text Module</strong>.
 
 255 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_editmodule">Edit Module</a></dt>
 
 258 <code>del</code>, <code>ins</code>
 
 260 When this module is used, the <code>del</code> and <code>ins</code> elements
 
 261 are added to the <em>Inline</em>
 
 262 content set of the <strong>Text Module</strong>.
 
 266 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_bdomodule">Bidirectional Text Module</a></dt>
 
 271 When this module is used, the <code>bdo</code> element is added to the
 
 272 <em>Inline</em> content set of the <strong>Text Module</strong>.
 
 276 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_extformsmodule">Forms Module</a></dt>
 
 279 <code>button</code>, <code>fieldset</code>, <code>form</code>, <code>input</code>, <code>label</code>, <code>legend</code>, <code>select</code>, <code>optgroup</code>, <code>option</code>, <code>textarea</code>
 
 282 This module defines two content sets:
 
 285   <dd><code>form</code> | <code>fieldset</code></dd>
 
 287   <dd><code>input</code> | <code>select</code> | <code>textarea</code> | <code>label</code> | <code>button</code></dd>
 
 290 When this module is used, it adds the <em>Form</em> content set to the
 
 291 <em>Block </em>content set and it adds the <em>Formctrl</em> content set to
 
 292 the <em>Inline</em> content set as these are defined in the <strong>Text
 
 297 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_tablemodule">Table Module</a></dt>
 
 300 <code>caption</code>, <code>col</code>, <code>colgroup</code>, <code>table</code>, <code>tbody</code>, <code>td</code>, <code>tfoot</code>, <code>th</code>, <code>thead</code>, <code>tr</code>
 
 302 When this module is used, it adds the <code>table</code> element to the
 
 303 <em>Block</em> content set of the <strong>Text Module</strong>.
 
 307 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_imagemodule">Image Module</a></dt>
 
 312 When this module is used, it adds the <code>img</code> element to the <em>Inline</em> content set of
 
 313 the <strong>Text Module</strong>.
 
 317 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_imapmodule">Client-side Image Map Module</a></dt>
 
 320 <code>area</code>, <code>map</code>
 
 321 When this module is used, the <code>map</code> element is added to the <em>Inline</em> content set
 
 322 of the <strong>Text Module</strong>.
 
 325 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_servermapmodule">Server-side Image Map Module</a></dt>
 
 327 <dd>Attribute <code>ismap</code> on <code>img</code></dd>
 
 329 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_intrinsiceventsmodule">Intrinsic Events Module</a></dt>
 
 331 <dd>Events attributes</dd>
 
 333 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_metamodule">Metainformation Module</a></dt>
 
 335 <dd><code>meta</code></dd>
 
 337 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_scriptmodule">Scripting Module</a></dt>
 
 339 <dd><code>noscript</code>, <code>script</code></dd>
 
 341 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_stylemodule">Stylesheet Module</a></dt>
 
 343 <dd><code>style</code> element</dd>
 
 345 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_styleattributemodule">Style Attribute Module</a> <em>Deprecated</em></dt>
 
 347 <dd><code>style</code> attribute</dd>
 
 349 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_linkmodule">Link Module</a></dt>
 
 351 <dd><code>link</code></dd>
 
 353 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_basemodule">Base Module</a></dt>
 
 355 <dd><code>base</code></dd>
 
 358 <p>XHTML also uses the Ruby Annotation module as defined in [<a href="http://www.w3.org/TR/xhtml11/references.html#ref_ruby">RUBY</a>]:</p>
 
 363 <h3>Structure Module</h3>
 
 366   We don't show explicit examples for elements in the
 
 367   Structure module because they are Singleton elements, already used for the
 
 368   structure of this very page. Although you can style the <code>body</code> 
 
 369   and <code>html</code>
 
 376 The Text module elements can be used inside a text to enrich it semantically.
 
 377 They are all style-able.
 
 380 <dl class="examples">
 
 383   We all know what <abbr title="eXtensible Hypertext Markup Language">XHTML</abbr>
 
 389   On the contrary someone doesn't know <acronym title="RAdio Detection And Ranging">RADAR</acronym> is
 
 396   <address>Naples, Italy</address>
 
 397   a strange, still beautiful, city.
 
 403   <blockquote cite="myself"><p>Better looser than poser!</p></blockquote>
 
 404   Not very widespread these days.
 
 408   <dd>Break the line here<br />this is new line</dd>
 
 411   <dd>Even if you are not Buddhist follow the <cite>Dalai Lama</cite>
 
 415   <dd>Format source code using the <code><code></code></code>
 
 419   <dd>I wonder how much my silly definition of happiness:
 
 421     <dfn>Happiness</dfn> is the limit of our mood function when “how I currently feel” approaches
 
 422     to “how I want to feel”
 
 429   DIVs are used to <div>divide</div> block elements.
 
 434   This <em>em</em> is not really a typographical measure.
 
 439   This could be for <h1>Book</h1> titles.
 
 444   This could be for <h2>Chapter</h2> titles.
 
 449   This could be for <h3>Section</h3> titles.
 
 454   This could be for <h4>Sub-Section</h4> titles.
 
 459   This could be for <h5>Sub-Sub-Section</h5> titles.
 
 464   This could be for <h6>Sub-Sub-Sub-Section</h6> titles.
 
 469   Do not press <kbd>Ctrl-Q</kbd>, really!
 
 474   Is this before a paragraph?
 
 476   A paragraph (from the Greek <em>paragraphos</em>, “to write beside” or “written
 
 477   beside”) is a self-contained unit of a discourse in writing dealing with a
 
 478   particular point or idea.
 
 480   After a paragraph, definitely!
 
 485   How to use this element?
 
 493 ...."Have you mooed today?"...
 
 495   Aaah, this is c<kbd>^H</kbd>how.
 
 500   British say about driving: <q cite="http://books.google.it/books?id=N2AOAAAAQAAJ&pg=PA45&lpg=PA45;">If you go
 
 501     left you go right, if you go right you go wrong</q>.
 
 506   Let's clean up this file:
 
 508     tidy -xml -access 3 -utf-8 -i -m $THIS_FILE
 
 514   Because <span class="span">style</span> matters?
 
 519   Be <strong>strong</strong> rather than bold!
 
 524   This file name is in <var>$THIS_FILE</var>... this is just an example, you
 
 530 <h3>Hypertext module</h3>
 
 535   Is this xhtml: <a title="Go on top of the page (internal link)"
 
 536   href="#top">GOTO 0;</a>?<br />
 
 537   Is this more accessible: <a title="Go on top of the page with an access key (internal link)"
 
 538   accesskey="g" href="#top">IF KEY == 'g'; THEN GOTO 0; ENDIF;</a>? (Psst, use
 
 539   <kbd>Alt-Shift-g</kbd> to test it in FireFox)<br />
 
 540    It is <a title="Hypertext module (external link)"
 
 541    href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_hypertextmodule">XHTML</a>
 
 549 For the list modules we show grouped examples, a <code>dd</code> or a
 
 550 <code>li</code> element alone does not have much sense.
 
 560         To understand recursion you must have understood what recursion means.
 
 600 <h3>Object module</h3>
 
 603   <dt>object, param</dt>
 
 605     <object data="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Utah_teapot_simple_2.png/300px-Utah_teapot_simple_2.png" type="image/png">
 
 607     <param name="author" value="Martin Newell"/>
 
 608     <param name="source" value="http://en.wikipedia.org/wiki/Utah_teapot"/>
 
 613 <h3>Presentation module</h3>
 
 617     This is the <b>bold</b> style.
 
 621     This is <big>bigger</big> than the rest.
 
 629     This is the <i>italic</i> style.
 
 633   Can you still <small>read it</small>?
 
 637   Remember, (10)<sub>10</sub> in binary is 1010.
 
 641   This is the 1<sup>st</sup> example that came to my kind.
 
 645     This is the <tt>teletype</tt> style.
 
 654     Are you a <del>deletionist</del><ins>inclusionist</ins> on Wikipedia?
 
 659 <h3>Bidirectional Text module</h3>
 
 664     <bdo dir="rtl">Should I add an example in Arabian?</bdo>
 
 668 <h3>Forms module</h3>
 
 671 For the Forms module a grouped example is provided:
 
 675   <dt>button, fieldset, form, input, label, legend, select, optgroup, option, textarea</dt>
 
 678   <script type="text/javascript">
 
 680 function checksubmit()
 
 682   alert('No, really?');
 
 687   <form id="example_form" action="" method="get">
 
 689       <legend>Example Form</legend>
 
 691         <label for="username">Username:</label>
 
 692         <input id="username" name="username" type="text" value="ao2" readonly="readonly" />
 
 695         <label for="passwd">Password:</label>
 
 696         <input id="passwd" name="passwd" type="password"/>
 
 699         <label for="autologin">Auto Login:</label>
 
 700         <input id="autologin" name="autologin" type="checkbox" checked="checked"/>
 
 703         <label for="user_sex_male">Male:</label>
 
 704         <input id="user_sex_male" name="user_sex" type="radio" checked="checked"/>
 
 707         <label for="user_sex_female">Female:</label>
 
 708         <input id="user_sex_female" name="user_sex" type="radio"/>
 
 711         <label for="form_submit">Submit:</label>
 
 712         <input id="form_submit" name="form_submit" type="submit" disabled="disabled" accesskey="S"/>
 
 715         <label for="form_reset">Reset:</label>
 
 716         <input id="form_reset" name="form_reset" type="reset"/>
 
 719         <label for="pgp_key">PGP Key:</label>
 
 720         <input id="pgp_key" name="pgp_key" type="file"/>
 
 722       <input id="base_uid" name="base_uid" type="hidden" value="1000"/>
 
 724         <label for="form_logo">logo:</label>
 
 725         <input id="form_logo" name="form_logo" type="image" src="http://localhost/nologo" alt="Logo not available"/>
 
 728       <label for="user_country">User Coutry:</label>
 
 729       <select id="user_country" name="country">
 
 730         <option value ="-1">Choose you country</option>
 
 731         <optgroup label="Asia">
 
 732           <option value ="1">Japan</option>
 
 733           <option value ="2">Kore</option>
 
 734           <option value ="3">China</option>
 
 736         <optgroup label="Europe" disabled="disabled">
 
 737           <option value ="4">England</option>
 
 738           <option value ="5">Italy</option>
 
 739           <option value ="6">Germany</option>
 
 744         <label for="user_info">User Info:</label><br />
 
 745         <textarea id="user_info" name="user_info" rows="4" cols="80">
 
 746 Some info like favourite dishes and so on...
 
 753       <input id="agree" name="agree" type="checkbox"/>
 
 754       <label for="agree">I have read and understood the code</label>
 
 755       <button id="send_button" type="submit" onclick="checksubmit();">Submit?</button>
 
 762 <h3>Table module</h3>
 
 765 For the Table module a grouped example is provided:
 
 769 <dt>caption, col, colgroup, table, tbody, td, tfoot, th, thead, tr</dt>
 
 772 <table id="example_table" summary="Example of table" title="Example table" frame="box">
 
 773   <caption>This is an example</caption>
 
 775     <col span="1" align="char" char="," charoff="50%" style="background: #00ff00"/>
 
 776     <col span="1" align="right"/>
 
 778   <colgroup span="2" align="right" style="background: #ff0000;" />
 
 792       <td colspan="2">0</td>
 
 797       <td rowspan="2">January</td>
 
 819 <h3>Image module</h3>
 
 825 This is an image: <img alt="No image" title="W3c logo"
 
 826 src="http://www.w3.org/Icons/w3c_main" style="vertical-align: middle;"/> centered on the line. 
 
 831 <h3>Client-side Image Map module</h3>
 
 838     <area nohref="nohref" alt="Vesuvio" title="Vesuvio" shape="poly"
 
 839     coords="156,183, 180,177, 203,167, 213,162, 225,160, 244,163, 266,155, 278,157, 286,163, 309,170, 331,175, 353,179, 372,184, 325,183, 287,179, 256,182, 232,184, 196,183, 156,183, 156,183, 156,183" />
 
 840     <area href="http://en.wikipedia.org/wiki/Napoli" alt="Napoli" title="Napoli" shape="poly"
 
 841     coords="0,360, 480,360, 480,272, 410,259, 386,257, 423,278, 408,283, 384,278, 342,286, 260,272, 208,261, 173,231, 215,219, 272,212, 308,208, 253,204, 218,201, 129,201, 57,197, 0,188, 0,360" />
 
 842     <area nohref="nohref" alt="Moon" title="Moon" shape="circle"
 
 843     coords="442,128,10" />
 
 845   <img src="http://silvioirio.files.wordpress.com/2008/01/napoli2.jpg" alt="Napoli" usemap="map1" />
 
 850 <h3>Server-side Image Map module</h3>
 
 853 <dt>Attribute ismap on img</dt>
 
 859 <h3>Intrinsic Events module</h3>
 
 862 <dt>Events attributes</dt>
 
 868 <h3>Metainformation module</h3>
 
 877 <h3>Scripting module</h3>
 
 880 <dt>script, noscript</dt>
 
 886 <h3>Stylesheet module</h3>