<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MaggsWeb:7 &#187; XHTML</title>
	<atom:link href="http://www.maggsweb.com/tag/xhtml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maggsweb.com</link>
	<description>www.maggsweb.com</description>
	<lastBuildDate>Sat, 21 Aug 2010 20:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HTML to XHTML</title>
		<link>http://www.maggsweb.com/miscellaneous/html-to-xhtml/</link>
		<comments>http://www.maggsweb.com/miscellaneous/html-to-xhtml/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 11:35:42 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=645</guid>
		<description><![CDATA[Here's a quick check list of the important requirements of XHTML and the differences between it and HTML.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick check list of the important requirements of XHTML and the differences between HTML and XHTML.<br />
<span id="more-645"></span><br />
This is NOT a comprehensive XHTML language reference.</p>
<h2>All tags, attributes and values must be written in lowercase.</h2>
<p>Right: &lt;a href=&#8221;www.kilroyjames.co.uk&#8221; &gt;<br />
Wrong:  &lt;A HREF=&#8221;www.kilroyjames.co.uk&#8221; &gt;</p>
<h2>All attribute values must be within quotes</h2>
<p>Right: &lt;a href=&#8221;www.kilroyjames.co.uk&#8221; &gt;<br />
Wrong: &lt;a href=www.kilroyjames.co.uk &gt;</p>
<h2>All tags must be properly nested</h2>
<p>Right: &lt;em&gt;this emphasis just keeps getting &lt;strong&gt;stronger and stronger&lt;/strong&gt;&lt;/em&gt;<br />
Wrong: &lt;em&gt;this emphasis just keeps getting &lt;strong&gt;stronger and stronger&lt;/em&gt;&lt;/strong&gt;</p>
<h2>All XHTML documents must carry a DOCTYPE definition</h2>
<p>The DOCTYPE is an intimidating looking piece of code that must appear at the start of every XHTML document, it tells the browser how to render the document.</p>
<h3>Rules for the DOCTYPE tag:</h3>
<p>* It must be the first tag in the document<br />
* The DOCTYPE is not actually part of the XHTML document so don&#8217;t add a closing slash<br />
* It should point to a valid definition file called a DTD that tells the browser how to read the document<br />
* You must write the DOCTYPE tag correctly otherwise your document will explode (into little pieces of HTML called &#8220;tag soup&#8221;) and be unvalidatable.</p>
<p>There are three types of valid XHTML 1.0 document: Strict, Transitional, and Frameset. If you can get your document to validate with &#8220;Strict&#8221; then do so, however some legacy tags and attributes aren&#8217;t allowed in Strict so you can use &#8220;Transitional&#8221; instead.</p>
<p>Note also that using a Transitional DTD takes most browsers out of &#8220;Standards&#8221; mode. It is much trickier to get your web pages to look consistent across different browsers when the browsers are not in Standards mode. I&#8217;m not going to explain the minutae of the DOCTYPE tag as it gets deeper and more complicated, just know that for best results you should use one of the following, preferably the first one (Strict):</p>
<p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221;<br />
&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt;</p>
<p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221;<br />
&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;</p>
<h2>The HTML tag must contain an XMLNS attribute</h2>
<p>You don&#8217;t need to understand the &#8220;XML namespace&#8221; attribute, except to know that it is required in all XHTML documents. Here is an example of how to write it:</p>
<p>&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;</p>
<h2>Documents must be properly formed with HTML, HEAD, TITLE and BODY tags</h2>
<p>In HTML it is possible to write a webpage that contains none of the above tags; in XHTML it is not. The above tags must be included and they must be nested and ordered correctly, as follows (the DOCTYPE has been omitted):</p>
<p>&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;p&gt;<br />
See how the TITLE must be placed in the document HEAD – the TITLE is considered<br />
to be a &#8220;required child&#8221; element of the HEAD.<br />
Notice that the HEAD must also appear before the document BODY.<br />
Notice also how both the HEAD and the BODY must be contained<br />
within the HTML tag. Again, HEAD and BODY are &#8220;required child&#8221;<br />
elements of the HTML tag. Finally, notice that this text is<br />
written within a &lt;p&gt;paragraph&lt;/p&gt; tag; in XHTML you may<br />
not write text directly in the BODY tag without using a suitable<br />
container tag, such as &lt;p&gt; or &lt;div&gt;.<br />
&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<h2>All tags must be closed, even single tags</h2>
<p>Wrong:</p>
<p>&lt;p&gt;Mary had a little lamb<br />
&lt;p&gt;It&#8217;s fleece was white as snow</p>
<p>Right:</p>
<p>&lt;p&gt;Mary had a little lamb&lt;/p&gt;<br />
&lt;p&gt;It&#8217;s fleece was white as snow&lt;/p&gt;</p>
<h2>In XHTML even single tags have to be closed &#8211; absolutely NO tag may be left open.</h2>
<p>Wrong:&lt;p&gt;Mary had a little lamb &lt;br&gt;It&#8217;s fleece was white as snow&lt;/p&gt;</p>
<p>Right: &lt;p&gt; Mary had a little lamb &lt;br/&gt; It&#8217;s fleece was white as snow&lt;/p&gt;</p>
<h2>Attribute minimisation isn&#8217;t allowed</h2>
<p>In HTML, attributes can be strung together almost like they were keywords, ie. &lt;dl compact&gt;, this is called attribute minimisation. In XHTML that is not allowed, attributes and values must be excplicit, ie.</p>
<p>&lt;dl compact=&#8221;compact&#8221;&gt;</p>
<h2>ID and NAME attributes</h2>
<p>In HTML it was legal to use ID and NAME attributes interchangeably. In XHTML the NAME attribute is formally deprecated and cannot be used. In all cases where you would think to use a NAME attribute you must now use ID instead. e.g.</p>
<p>Correct HTML: &lt;input type=&#8221;submit&#8221; name=&#8221;s&#8221; value=&#8221; Search &#8221; &gt;</p>
<p>Correct XHTML:&lt;input type=&#8221;submit&#8221; id=&#8221;s&#8221; value=&#8221; Search &#8221; /&gt;</p>
<h2>STYLE is all in your HEAD</h2>
<p>XHTML does not allow STYLE or SCRIPT declarations within the body of a document they must be placed in the document HEAD instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/miscellaneous/html-to-xhtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using CSS for form layout (No more tables.. )</title>
		<link>http://www.maggsweb.com/css/css-form-layout-2/</link>
		<comments>http://www.maggsweb.com/css/css-form-layout-2/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 13:16:39 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web2.0]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.cmaggs.co.uk/html/32</guid>
		<description><![CDATA[Form fields need to line up. OK. Historically this was achieved using a table, and masses of markup. Although that&#8217;s still acceptable and would not fail validation, there is an easier and better way that uses less code and where using the correct tags will also cause the &#8216;name&#8217; field become focused when you clicked [...]]]></description>
			<content:encoded><![CDATA[<p>Form fields need to line up.  OK.  Historically this was achieved using a table, and masses of markup.  Although that&#8217;s still acceptable and would not fail validation, there is an easier and better way that uses less code and where using the correct tags will also cause the &#8216;name&#8217; field become <em>focused </em>when you clicked the &#8216;name&#8217; <em>label</em>.
</p>
<p>
Using CSS we can achieve this using less code, while providing improved usability.
</p>
<p><span id="more-32"></span></p>
<ul>
<li> Use a &lt;P&gt; tag to distinguish each line.</li>
<li> Use a &lt;label&gt; with the <em>name</em> attribute to link to an input with the same name attribute to create the links.</li>
<li> Put the &lt;label&gt; inside the &lt;P&gt; tag with a fixed width, floated left</li>
<li> Use the padding (inside) and margin (outside) on the &lt;P&gt; tag for spacing.</li>
</ul>
<p>Perfect!<br />
<br />
<a href="http://www.maggsweb.com/css/css-form-layout-2/attachment/cssform/" rel="attachment wp-att-375"><img src="http://www.maggsweb.com/wp-content/uploads/2008/03/cssForm.jpg" alt="cssForm" title="cssForm" width="310" height="157" class="size-full wp-image-375" /></a></p>
<p></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p32code3'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p323"><td class="code" id="p32code3"><pre class="html" style="font-family:monospace;">&nbsp;
&lt;form action=&quot;#&quot;&gt;
&lt;p&gt;&lt;label for=&quot;name&quot;&gt;Name&lt;/label&gt;&lt;input id=&quot;name&quot; type=&quot;text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;label for=&quot;e-mail&quot;&gt;E-mail&lt;/label&gt;&lt;input id=&quot;e-mail&quot; type=&quot;text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/p&gt;
&lt;/form&gt;</pre></td></tr></table></div>

<p></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p32code4'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p324"><td class="code" id="p32code4"><pre class="css" style="font-family:monospace;">&nbsp;
p <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
p<span style="color: #6666ff;">.submit</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">110px</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span>
label <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/css-form-layout-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple centering &#8211; XHTML style&#8230;</title>
		<link>http://www.maggsweb.com/css/simple-centering-cross-browser-compatible/</link>
		<comments>http://www.maggsweb.com/css/simple-centering-cross-browser-compatible/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 19:17:19 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.cmaggs.co.uk/?p=9</guid>
		<description><![CDATA[The perfect place to start &#8211; a centrally aligned &#8216;wrapper&#8217;. You must have the DTD (Document Type Definition) declared for this to work. ?View Code HTML&#160; &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62; &#160; &#60;style type='text/css'&#62; body { text-align: center; } #container { margin: 0 auto;} &#60;/style&#62; &#160; &#60;body&#62; &#60;div id=&#34;container&#34;&#62; &#60;!-- [...]]]></description>
			<content:encoded><![CDATA[<p>The perfect place to start &#8211; a centrally aligned &#8216;wrapper&#8217;.<br />
You must have the DTD (Document Type Definition) declared for this to work.<br />
<span id="more-270"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p270code6'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2706"><td class="code" id="p270code6"><pre class="html" style="font-family:monospace;">&nbsp;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
	&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&nbsp;
&lt;style type='text/css'&gt;
body {    text-align: center;    }
#container {    margin: 0 auto;}
&lt;/style&gt;
&nbsp;
&lt;body&gt;
    &lt;div id=&quot;container&quot;&gt;
	    &lt;!-- Content Here --&gt;
    &lt;/div&gt;
&lt;/body&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/simple-centering-cross-browser-compatible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8216;Box Model&#8217; without hacking.</title>
		<link>http://www.maggsweb.com/css/box-model-without-hacking/</link>
		<comments>http://www.maggsweb.com/css/box-model-without-hacking/#comments</comments>
		<pubDate>Mon, 02 Oct 2006 12:13:15 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[box model]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.cmaggs.co.uk/?p=7</guid>
		<description><![CDATA[Implementing a W3C valid, cross-browser compatible CSS2 &#8216;Box Model&#8217;, overcoming the bugs in IE without hacking. ?View Code CSS#Column &#123; padding: 100px !important; padding: 70px; &#160; /* &#60;strong&#62;!important&#60;/strong&#62; is ignored by IE so IE overwrites the initial padding value with the next entry. The secondary value is ignored by Mozilla, as the primary value contains [...]]]></description>
			<content:encoded><![CDATA[<p>Implementing a W3C valid, cross-browser compatible CSS2 &#8216;Box Model&#8217;, overcoming the bugs in IE without hacking.<br />
<span id="more-268"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p268code8'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2688"><td class="code" id="p268code8"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#Column</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> !important<span style="color: #00AA00;">;</span>
 	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">70px</span><span style="color: #00AA00;">;</span>
&nbsp;
 	<span style="color: #808080; font-style: italic;">/* &lt;strong&gt;!important&lt;/strong&gt; is ignored by IE
 	so IE overwrites the initial padding value with the next entry.
 	The secondary value is ignored by Mozilla,
 	as the primary value contains !important */</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">450px</span> !important<span style="color: #00AA00;">;</span> 	<span style="color: #808080; font-style: italic;">/* Mozilla */</span>
 	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">400px</span><span style="color: #00AA00;">;</span> 			<span style="color: #808080; font-style: italic;">/* IE */</span>
&nbsp;
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/css/box-model-without-hacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
