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="text/html; 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">
30 /* Style-able elements are those which have the 'style' attribute */
32 /* Structure module */
34 html {} /* style-able? */
66 /* Hypertext module */
83 /* Presentation module */
97 /* Bidirectional text module */
127 /* Client-side Image Map Module */
133 /* Scripting module */
144 <h1>XHTML 1.1 Quick Reference by examples</h1>
147 <p>This page offers a quick reference by examples of all the elements specified by the <a title="eXtensible
148 Hypertext Markup language 1.1"
149 href="http://www.w3.org/TR/xhtml11/">XHTML 1.1</a> W3C standard.</p>
151 <p>This version of XHTML groups the elements by <a title="XHTML Abstract Modules"
152 href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html">module</a>, and this is how they are presented here,
153 with a very brief description and a section of examples of use.</p>
155 <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>
159 <p>The XHTML 1.1 document type is made up of the XHTML <em>modules</em> shown
160 below. The elements, attributes, and minimal content models associated with
161 these modules are defined in the <a title="XHTML Modularization"
162 href="http://www.w3.org/TR/xhtml11/references.html#ref_xhtml_modularization">XHTML
163 Modularization</a> document [<a title="XHTML Modularization"
164 href="http://www.w3.org/TR/xhtml11/references.html#ref_xhtml_modularization">XHTMLMOD</a>]).
165 The elements are listed here for information purposes, but the definitions in
166 [<a title="XHTML Modularization"
167 href="http://www.w3.org/TR/xhtml11/references.html#ref_xhtml_modularization">XHTMLMOD</a>]
168 should be considered definitive.
169 In this document, the module names in the list below link into the
171 the modules within the current version of [<a title="XHTML Modularization"
172 href="http://www.w3.org/TR/xhtml11/references.html#ref_xhtml_modularization">XHTMLMOD</a>].</p>
175 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_structuremodule">Structure Module</a>*</dt>
177 <dd><code>body</code>, <code>head</code>, <code>html</code>, <code>title</code></dd>
179 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_textmodule">Text Module</a>*</dt>
182 <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>
187 The minimal content model for this module defines some content sets:
191 <dd><code>h1</code> | <code>h2</code> | <code>h3</code> | <code>h4</code> | <code>h5</code> | <code>h6</code></dd>
195 <dd><code>address</code> | <code>blockquote</code> | <code>div</code> | <code>p</code> | <code>pre</code></dd>
199 <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>
203 <dd><em>Heading</em> | <em>Block</em> | <em>Inline</em></dd>
209 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_hypertextmodule">Hypertext Module</a>*</dt>
214 This module adds the <code>a</code> element to the <em>Inline</em> content set
215 of the <strong>Text Module</strong>
220 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_listmodule">List Module</a>*</dt>
223 <code>dl</code>, <code>dt</code>, <code>dd</code>, <code>ol</code>, <code>ul</code>, <code>li</code>
225 This module also defines the content set <em>List</em> with the minimal content model
226 (<code>dl</code> | <code>ol</code> | <code>ul</code>)+ and adds this set to the <em>Flow</em> content set of the
227 <strong>Text Module</strong>.
231 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_objectmodule">Object Module</a></dt>
234 <code>object</code>, <code>param</code>
236 When this module is used, it adds the <code>object</code> element to the <em>Inline</em> content set
237 of the <strong>Text Module</strong>.
241 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_presentationmodule">Presentation Module</a></dt>
244 <code>b</code>, <code>big</code>, <code>hr</code>, <code>i</code>, <code>small</code>, <code>sub</code>, <code>sup</code>, <code>tt</code>
246 When this module is used, the <code>hr</code> element is added to the
247 <em>Block</em> content set of the <strong>Text Module</strong>. In addition,
248 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
249 added to the <em>Inline</em> content set of the <strong>Text Module</strong>.
253 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_editmodule">Edit Module</a></dt>
256 <code>del</code>, <code>ins</code>
258 When this module is used, the <code>del</code> and <code>ins</code> elements
259 are added to the <em>Inline</em>
260 content set of the <strong>Text Module</strong>.
264 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_bdomodule">Bidirectional Text Module</a></dt>
269 When this module is used, the <code>bdo</code> element is added to the
270 <em>Inline</em> content set of the <strong>Text Module</strong>.
274 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_extformsmodule">Forms Module</a></dt>
277 <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>
280 This module defines two content sets:
283 <dd><code>form</code> | <code>fieldset</code></dd>
285 <dd><code>input</code> | <code>select</code> | <code>textarea</code> | <code>label</code> | <code>button</code></dd>
288 When this module is used, it adds the <em>Form</em> content set to the
289 <em>Block </em>content set and it adds the <em>Formctrl</em> content set to
290 the <em>Inline</em> content set as these are defined in the <strong>Text
295 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_tablemodule">Table Module</a></dt>
298 <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>
300 When this module is used, it adds the <code>table</code> element to the
301 <em>Block</em> content set of the <strong>Text Module</strong>.
305 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_imagemodule">Image Module</a></dt>
310 When this module is used, it adds the <code>img</code> element to the <em>Inline</em> content set of
311 the <strong>Text Module</strong>.
315 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_imapmodule">Client-side Image Map Module</a></dt>
318 <code>area</code>, <code>map</code>
319 When this module is used, the <code>map</code> element is added to the <em>Inline</em> content set
320 of the <strong>Text Module</strong>.
323 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_servermapmodule">Server-side Image Map Module</a></dt>
325 <dd>Attribute <code>ismap</code> on <code>img</code></dd>
327 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_intrinsiceventsmodule">Intrinsic Events Module</a></dt>
329 <dd>Events attributes</dd>
331 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_metamodule">Metainformation Module</a></dt>
333 <dd><code>meta</code></dd>
335 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_scriptmodule">Scripting Module</a></dt>
337 <dd><code>noscript</code>, <code>script</code></dd>
339 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_stylemodule">Stylesheet Module</a></dt>
341 <dd><code>style</code> element</dd>
343 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_styleattributemodule">Style Attribute Module</a> <em>Deprecated</em></dt>
345 <dd><code>style</code> attribute</dd>
347 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_linkmodule">Link Module</a></dt>
349 <dd><code>link</code></dd>
351 <dt><a href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_basemodule">Base Module</a></dt>
353 <dd><code>base</code></dd>
356 <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>
361 <h3>Structure Module</h3>
363 We don't show explicit examples for elements in the
364 Structure module because they are Singleton elements, already used for the
365 structure of this very page. Although you can style the <code>body</code>
366 and <code>html</code>
371 The Text module elements can be used inside a text to enrich it semantically.
372 They are all style-able.
374 <dl class="examples">
377 We all know what <abbr title="eXtensible Hypertext Markup Language">XHTML</abbr>
383 On the contrary someone doesn't know <acronym title="RAdio Detection And Ranging">RADAR</acronym> is
390 <address>Naples, Italy</address>
391 a strange, still beautiful, city.
397 <blockquote cite="myself">Better looser than poser!</blockquote>
398 Not very widespread these days.
402 <dd>Break the line here<br />this is new line</dd>
405 <dd>Even if you are not Buddhist follow the <cite>Dalai Lama</cite>
409 <dd>Format source code using the <code><code></code></code>
413 <dd>I wonder how much my silly definition of happiness:
415 Happiness is the limit of our mood function when “how I currently feel” approaches
416 to “how I want to feel”
423 DIVs are used to <div>divide</div> block elements.
428 This <em>em</em> is not really a typographical measure.
433 This could be for <h1>Book</h1> titles.
438 This could be for <h2>Chapter</h2> titles.
443 This could be for <h3>Section</h3> titles.
448 This could be for <h4>Sub-Section</h4> titles.
453 This could be for <h5>Sub-Sub-Section</h5> titles.
458 This could be for <h6>Sub-Sub-Sub-Section</h6> titles.
463 Do not press <kbd>Ctrl-Q</kbd>, really!
468 Is this before a paragraph?
470 A paragraph (from the Greek <em>paragraphos</em>, “to write beside” or “written
471 beside”) is a self-contained unit of a discourse in writing dealing with a
472 particular point or idea.
474 After a paragraph, definitely!
479 How to use this element?
487 ...."Have you mooed today?"...
489 Aaah, this is c<kbd>^H</kbd>how.
494 British say about driving: <q cite="http://books.google.it/books?id=N2AOAAAAQAAJ&pg=PA45&lpg=PA45;">If you go
495 left you go right, if you go right you go wrong</q>.
500 Let's clean up this file:
502 tidy -xml -access 3 -utf-8 -i -m $THIS_FILE
508 Because <span class="span">style</span> matters?
513 Be <strong>strong</strong> rather than bold!
518 This file name is in <var>$THIS_FILE</var>... this is just an example, you
524 <h3>Hypertext module</h3>
529 Is this xhtml: <a title="Go on top of the page (internal link)"
530 href="#top">GOTO 0;</a>?<br />
531 Is this more accessible: <a title="Go on top of the page with an access key (internal link)"
532 accesskey="g" href="#top">IF KEY == 'g'; THEN GOTO 0; ENDIF;</a>? (Psst, use
533 <kbd>Alt-Shift-g</kbd> to test it in FireFox)<br />
534 It is <a title="Hypertext module (external link)"
535 href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_hypertextmodule">XHTML</a>
542 For the list modules we show grouped examples, a <code>dd</code> or a
543 <code>li</code> element alone does not have much sense.
552 To understand recursion you must have understood what recursion means.
592 <h3>Object module</h3>
595 <dt>object, param</dt>
597 <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">
599 <param name="author" value="Martin Newell"/>
600 <param name="source" value="http://en.wikipedia.org/wiki/Utah_teapot"/>
605 <h3>Presentation module</h3>
609 This is the <b>bold</b> style.
613 This is <big>bigger</big> than the rest.
621 This is the <i>italic</i> style.
625 Can you still <small>read it</small>?
629 Remember, (10)<sub>10</sub> in binary is 1010.
633 This is the 1<sup>st</sup> example that came to my kind.
637 This is the <tt>teletype</tt> style.
646 Are you a <del>deletionist</del><ins>inclusionist</ins> on Wikipedia?
651 <h3>Bidirectional Text module</h3>
656 <bdo dir="rtl">Should I add an example in Arabian?</bdo>
660 <h3>Forms module</h3>
662 For the Forms module a grouped example is provided:
665 <dt>button, fieldset, form, input, label, legend, select, optgroup, option, textarea</dt>
668 <script type="text/javascript">
670 function checksubmit()
672 alert('No, really?');
677 <form id="example_form" action="" method="get">
679 <legend>Example Form</legend>
681 <label for="username">Username:</label>
682 <input id="username" name="username" type="text" value="ao2" readonly="readonly" />
685 <label for="passwd">Password:</label>
686 <input id="passwd" name="passwd" type="password"/>
689 <label for="autologin">Auto Login:</label>
690 <input id="autologin" name="autologin" type="checkbox" checked="checked"/>
693 <label for="user_sex_male">Male:</label>
694 <input id="user_sex_male" name="user_sex" type="radio" checked="checked"/>
697 <label for="user_sex_female">Female:</label>
698 <input id="user_sex_female" name="user_sex" type="radio"/>
701 <label for="form_submit">Submit:</label>
702 <input id="form_submit" name="form_submit" type="submit" disabled="disabled" accesskey="S"/>
705 <label for="form_reset">Reset:</label>
706 <input id="form_reset" name="form_reset" type="reset"/>
709 <label for="pgp_key">PGP Key:</label>
710 <input id="pgp_key" name="pgp_key" type="file"/>
712 <input id="base_uid" name="base_uid" type="hidden" value="1000"/>
714 <label for="form_logo">logo:</label>
715 <input id="form_logo" name="form_logo" type="image" src="http://localhost/nologo" alt="Logo not available"/>
718 <label for="user_country">User Coutry:</label>
719 <select id="user_country" name="country">
720 <option value ="-1">Choose you country</option>
721 <optgroup label="Asia">
722 <option value ="1">Japan</option>
723 <option value ="2">Kore</option>
724 <option value ="3">China</option>
726 <optgroup label="Europe" disabled="disabled">
727 <option value ="4">England</option>
728 <option value ="5">Italy</option>
729 <option value ="6">Germany</option>
734 <label for="user_info">User Info:</label><br />
735 <textarea id="user_info" name="user_info">
736 Some info like favourite dishes and so on...
743 <input id="agree" name="agree" type="checkbox"/>
744 <label for="agree">I have read and understood the code</label>
746 <button id="send_button" type="submit" onclick="checksubmit();">Submit?</button>
752 <h3>Table module</h3>
754 For the Table module a grouped example is provided:
757 <dt>caption, col, colgroup, table, tbody, td, tfoot, th, thead, tr</dt>
760 <table id="example_table" summary="Example of table" title="Example table" frame="box">
761 <caption>This is an example</caption>
763 <col span="1" align="char" char="," charoff="50%" style="background: #00ff00"/>
764 <col span="1" align="right"/>
766 <colgroup span="2" align="right" style="background: #ff0000;" />
778 <td rowspan="2">January</td>
799 <td colspan="2">0</td>
808 <h3>Image module</h3>
814 This is an image: <img alt="No image" title="W3c logo"
815 src="http://www.w3.org/Icons/w3c_main" style="vertical-align: middle;"/> centered on the line.
820 <h3>Client-side Image Map module</h3>
826 <map id="map1" name="map1">
827 <area nohref="nohref" alt="Vesuvio" title="Vesuvio" shape="poly"
828 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" />
829 <area href="http://en.wikipedia.org/wiki/Napoli" alt="Napoli" title="Napoli" shape="poly"
830 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" />
831 <area nohref="nohref" alt="Moon" title="Moon" shape="circle"
832 coords="442,128,10" />
834 <img src="http://silvioirio.files.wordpress.com/2008/01/napoli2.jpg" alt="Napoli" usemap="#map1" />
839 <h3>Server-side Image Map module</h3>
842 <dt>Attribute ismap on img</dt>
848 <h3>Intrinsic Events module</h3>
851 <dt>Events attributes</dt>
857 <h3>Metainformation module</h3>
866 <h3>Scripting module</h3>
869 <dt>script, noscript</dt>
875 <h3>Stylesheet module</h3>