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
397 <a title="Naples, Italy"
398 href="http://maps.google.com/maps?f=q&source=s_q&hl=it&geocode=&q=naples,+IT&sll=26.160677,-81.795616&sspn=0.137744,0.265045&ie=UTF8&ll=40.869911,14.252701&spn=0.232099,0.53009&z=11&iwloc=A">Naples, Italy</a>,
399 a strange, still beautiful, city.<br/>
400 His website is at <a title="ao2: attacchi teoristici" href="http://ao2.it">ao2.it</a>
407 <blockquote cite="myself"><p>Better looser than poser!</p></blockquote>
408 Not very widespread these days.
412 <dd>Break the line here<br />this is new line</dd>
415 <dd>Even if you are not Buddhist follow the <cite>Dalai Lama</cite>
419 <dd>Format source code using the <code><code></code></code>
423 <dd>I wonder how much my silly definition of happiness:
425 <dfn>Happiness</dfn> is the limit of our mood function when “how I currently feel” approaches
426 to “how I want to feel”
433 DIVs are used to <div>divide</div> block elements.
438 This <em>em</em> is not really a typographical measure.
443 This could be for <h1>Book</h1> titles.
448 This could be for <h2>Chapter</h2> titles.
453 This could be for <h3>Section</h3> titles.
458 This could be for <h4>Sub-Section</h4> titles.
463 This could be for <h5>Sub-Sub-Section</h5> titles.
468 This could be for <h6>Sub-Sub-Sub-Section</h6> titles.
473 Do not press <kbd>Ctrl-Q</kbd>, really!
478 Is this before a paragraph?
480 A paragraph (from the Greek <em>paragraphos</em>, “to write beside” or “written
481 beside”) is a self-contained unit of a discourse in writing dealing with a
482 particular point or idea.
484 After a paragraph, definitely!
489 How to use this element?
497 ...."Have you mooed today?"...
499 Aaah, this is c<kbd>^H</kbd>how.
504 British say about driving: <q cite="http://books.google.it/books?id=N2AOAAAAQAAJ&pg=PA45&lpg=PA45;">If you go
505 left you go right, if you go right you go wrong</q>.
510 Let's clean up this file:
511 <pre>$ tidy -xml -access 3 -utf8 -i -m $THIS_FILE</pre>
513 No warnings or errors were found.
519 Because <span class="span">style</span> matters?
524 Be <strong>strong</strong> rather than bold!
529 Save this file to <var>xhtml11_quickref.html</var>... this is just an example value,
530 you can choose the name you like more.
535 <h3>Hypertext module</h3>
540 Is this xhtml: <a title="Go on top of the page (internal link)"
541 href="#top">GOTO 0;</a>?<br />
542 Is this more accessible: <a title="Go on top of the page with an access key (internal link)"
543 accesskey="g" href="#top">IF KEY == 'g'; THEN GOTO 0; ENDIF;</a>? (Psst, use
544 <kbd>Alt-Shift-g</kbd> to test it in FireFox)<br />
545 It is <a title="Hypertext module (external link)"
546 href="http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_hypertextmodule">XHTML</a>
554 For the list modules we show grouped examples, a <code>dd</code> or a
555 <code>li</code> element alone does not have much sense.
565 To understand recursion you must have understood what recursion means.
605 <h3>Object module</h3>
608 <dt>object, param</dt>
610 <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">
612 <param name="author" value="Martin Newell"/>
613 <param name="source" value="http://en.wikipedia.org/wiki/Utah_teapot"/>
618 <h3>Presentation module</h3>
622 This is the <b>bold</b> style.
626 This is <big>bigger</big> than the rest.
634 This is the <i>italic</i> style.
638 Can you still <small>read it</small>?
642 Remember, (10)<sub>10</sub> in binary is 1010.
646 This is the 1<sup>st</sup> example that came to my kind.
650 This is the <tt>teletype</tt> style.
659 Are you a <del>deletionist</del><ins>inclusionist</ins> on Wikipedia?
664 <h3>Bidirectional Text module</h3>
669 <bdo dir="rtl">Should I add an example in Arabian?</bdo>
673 <h3>Forms module</h3>
676 For the Forms module a grouped example is provided:
680 <dt>button, fieldset, form, input, label, legend, select, optgroup, option, textarea</dt>
683 <script type="text/javascript">
685 function checksubmit()
687 alert('No, really?');
692 <form id="example_form" action="" method="get">
694 <legend>Example Form</legend>
696 <label for="username">Username:</label>
697 <input id="username" name="username" type="text" value="ao2" readonly="readonly" />
700 <label for="passwd">Password:</label>
701 <input id="passwd" name="passwd" type="password"/>
704 <label for="autologin">Auto Login:</label>
705 <input id="autologin" name="autologin" type="checkbox" checked="checked"/>
708 <label for="user_sex_male">Male:</label>
709 <input id="user_sex_male" name="user_sex" type="radio" checked="checked"/>
712 <label for="user_sex_female">Female:</label>
713 <input id="user_sex_female" name="user_sex" type="radio"/>
716 <label for="form_submit">Submit:</label>
717 <input id="form_submit" name="form_submit" type="submit" disabled="disabled" accesskey="S"/>
720 <label for="form_reset">Reset:</label>
721 <input id="form_reset" name="form_reset" type="reset"/>
724 <label for="pgp_key">PGP Key:</label>
725 <input id="pgp_key" name="pgp_key" type="file"/>
727 <input id="base_uid" name="base_uid" type="hidden" value="1000"/>
729 <label for="form_logo">logo:</label>
730 <input id="form_logo" name="form_logo" type="image" src="http://localhost/nologo" alt="Logo not available"/>
733 <label for="user_country">User Coutry:</label>
734 <select id="user_country" name="country">
735 <option value ="-1">Choose you country</option>
736 <optgroup label="Asia">
737 <option value ="1">Japan</option>
738 <option value ="2">Kore</option>
739 <option value ="3">China</option>
741 <optgroup label="Europe" disabled="disabled">
742 <option value ="4">England</option>
743 <option value ="5">Italy</option>
744 <option value ="6">Germany</option>
749 <label for="user_info">User Info:</label><br />
750 <textarea id="user_info" name="user_info" rows="4" cols="80">
751 Some info like favourite dishes and so on...
758 <input id="agree" name="agree" type="checkbox"/>
759 <label for="agree">I have read and understood the code</label>
760 <button id="send_button" type="submit" onclick="checksubmit();">Submit?</button>
767 <h3>Table module</h3>
770 For the Table module a grouped example is provided:
774 <dt>caption, col, colgroup, table, tbody, td, tfoot, th, thead, tr</dt>
777 <table id="example_table" summary="Example of table" title="Example table" frame="box">
778 <caption>This is an example</caption>
780 <col span="1" align="char" char="," charoff="50%" style="background: #00ff00"/>
781 <col span="1" align="right"/>
783 <colgroup span="2" align="right" style="background: #ff0000;" />
797 <td colspan="2">0</td>
802 <td rowspan="2">January</td>
824 <h3>Image module</h3>
830 This is an image: <img alt="No image" title="W3c logo"
831 src="http://www.w3.org/Icons/w3c_main" style="vertical-align: middle;"/> centered on the line.
836 <h3>Client-side Image Map module</h3>
843 <area nohref="nohref" alt="Vesuvio" title="Vesuvio" shape="poly"
844 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" />
845 <area href="http://en.wikipedia.org/wiki/Napoli" alt="Napoli" title="Napoli" shape="poly"
846 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" />
847 <area nohref="nohref" alt="Moon" title="Moon" shape="circle"
848 coords="442,128,10" />
850 <img src="http://silvioirio.files.wordpress.com/2008/01/napoli2.jpg" alt="Napoli" usemap="map1" />
855 <h3>Server-side Image Map module</h3>
858 <dt>Attribute ismap on img</dt>
864 <h3>Intrinsic Events module</h3>
867 <dt>Events attributes</dt>
873 <h3>Metainformation module</h3>
882 <h3>Scripting module</h3>
885 <dt>script, noscript</dt>
891 <h3>Stylesheet module</h3>