<?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"
	>

<channel>
	<title>Web Musings by Alistair Johnson</title>
	<atom:link href="http://alistairjohnson.com.au/webmusings/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://alistairjohnson.com.au/webmusings</link>
	<description>Thoughts on web design and development issues</description>
	<pubDate>Mon, 27 Oct 2008 14:14:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Javascript - graceful degradation</title>
		<link>http://alistairjohnson.com.au/webmusings/?p=52</link>
		<comments>http://alistairjohnson.com.au/webmusings/?p=52#comments</comments>
		<pubDate>Mon, 27 Oct 2008 14:13:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<category><![CDATA[graceful degradation]]></category>

		<guid isPermaLink="false">http://alistairjohnson.com.au/webmusings/?p=52</guid>
		<description><![CDATA[In the context of javascript, &#8216;graceful degradation&#8217; involves ensuring that your site will still function for users that do not have javascript enabled. After reading a plethora of pro web standards literature and books such as Jeremy Keith&#8217;s DOM scripting, the importance of graceful degradation is drilled into your mind. When I commenced my project [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0cm;">In the context of javascript, &#8216;graceful degradation&#8217; involves ensuring that your site will still function for users that do not have javascript enabled. After reading a plethora of pro web standards literature and books such as Jeremy Keith&#8217;s DOM scripting, the importance of graceful degradation is drilled into your mind. When I commenced my project this semester, ensuring graceful degradation was a high priority.</p>
<p style="margin-bottom: 0cm;">However as I have read more web development material and tested many of the world&#8217;s largest sites  with javascript disabled in my browser, it has become apparent to me that not everyone in the web development community considers graceful degradation important.</p>
<p style="margin-bottom: 0cm;">Over time, my opinion on the matter has also relaxed somewhat. Sure in a &#8216;web utopia&#8217;, every web site would support all possible combinations of browser set ups that a user may have. In reality however, there are other factors that come into consideration. According to the W3Schools website (<a href="http://www.w3schools.com/browsers/browsers_stats.asp">http://www.w3schools.com/browsers/browsers_stats.asp</a>), less than 5% of browsers have javascript disabled. If you are spending a large amount of time and resources ensuring compatibility for this minority group, a simple cost-benefit analysis may be useful. You may deduce that the benefit of supporting this minority  is simply not worth the added cost of doing so. Especially considering that javascript adoption on all browsers (including mobile devices) is increasing each year. Although we may be passionate (and stubborn) about  web standards issues like graceful degradation, sometimes it is necessary to sit back and consider other factors before making such decisions. If you agree, disagree or have any other thoughts on matters like this, please feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://alistairjohnson.com.au/webmusings/?feed=rss2&amp;p=52</wfw:commentRss>
		</item>
		<item>
		<title>My favourite Firefox extensions</title>
		<link>http://alistairjohnson.com.au/webmusings/?p=47</link>
		<comments>http://alistairjohnson.com.au/webmusings/?p=47#comments</comments>
		<pubDate>Fri, 24 Oct 2008 13:29:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[extensions]]></category>

		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://alistairjohnson.com.au/webmusings/?p=47</guid>
		<description><![CDATA[I thought I would share with you a summary of the firefox extensions that I have found to be invaluable for work on my project this semester (in order of usefulness) :
Firebug
This is the ultimate firefox extension 	for any web designer/developer. It&#8217;s functionality includes:

 Inspect and edit HTML &#38; CSS – 	firebug allows you to [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0cm;">I thought I would share with you a summary of the firefox extensions that I have found to be invaluable for work on my project this semester (in order of usefulness) :</p>
<p style="margin-bottom: 0cm;"><strong><span style="text-decoration: underline;">Firebug</span></strong></p>
<p style="margin-bottom: 0cm;">This is the ultimate firefox extension 	for any web designer/developer. It&#8217;s functionality includes:</p>
<ul>
<li> <strong>Inspect and edit HTML &amp; CSS</strong> – 	firebug allows you to easily scan through your html source code and 	CSS and make changes on-the-fly. This is a great way to make test 	minor changes to your html and css to see the effect immediately, 	without the need to change the content of the actual files. In 	addition, if something in your page doesn&#8217;t look right but you can&#8217;t 	locate the required css or html in your code, simply hover over the 	offending element in your page and firebug will instantly display 	the html and css relevant in that context.</li>
<li><strong>Box Model shading</strong> – as you hover 	your mouse over an html element, firebug will display the elements 	margin, padding and content in different colours on the page. It&#8217;s a 	great way to visualise the effect of margins and padding on 	different elements.</li>
<li><strong>Debug and profile javascript</strong> - Firebug 	includes a powerful JavaScript debugger that lets you pause 	execution at any time and have look at the state of the world. If 	your code is a little sluggish, you can use the JavaScript profiler 	to measure performance and find bottlenecks fast.</li>
</ul>
<p style="margin-bottom: 0cm;"><strong><span style="text-decoration: underline;">Web Developer Toolbar</span></strong></p>
<p style="margin-bottom: 0cm; text-decoration: none;">Thanks goes to Alastair for recommending this extension. Among other things, I find It most useful for:</p>
<ul>
<li>outlining 	elements on the page to assist with alignment and/or padding issues.</li>
</ul>
<ul>
<li>Providing a 	ruler so that I can get a general idea of the measurements I have to 	work with for various elements, divs and images</li>
</ul>
<ul>
<li>providing a 	quick link to conduct html and css validation of the current page</li>
</ul>
<ul>
<li>a menu to 	resize the viewport to a set of common screen resolutions (this was 	particularly handy as my final project uses a liquid page layout and 	needed to be tested at various resolutions)</li>
</ul>
<ul>
<li>the option 	to quickly disable javascript, so that your site&#8217;s functionality can 	be tested under circumstances without javascript available.</li>
</ul>
<p style="margin-bottom: 0cm; text-decoration: none;">
<p style="margin-bottom: 0cm;"><strong><span style="text-decoration: underline;">FireFTP</span></strong></p>
<p style="margin-bottom: 0cm; text-decoration: none;">This is a really nice lightweight ftp program that presents a really simple intuitive interface for your ftp needs. No need to download a stand-alone ftp program when this simple extension will fulfill most people&#8217;s requirements.</p>
<p style="margin-bottom: 0cm;"><strong><span style="text-decoration: underline;">UrlParams</span></strong></p>
<p style="margin-bottom: 0cm; text-decoration: none;">This extension will show any GET or POST parameters that are sent between pages of a website. I found particularly helpful when testing the functionality of the forms on my site and useful in debugging any unexpected form behaviour.</p>
<p style="margin-bottom: 0cm;"><strong><span style="text-decoration: underline;">Livehttpheaders</span></strong></p>
<p style="margin-bottom: 0cm; text-decoration: none;">This extension will display all http header information as you browse a website. Although not very important within the scope of this course, it helped improve my my understanding of how http operates.</p>
<p style="margin-bottom: 0cm; text-decoration: none;">
<p style="margin-bottom: 0cm; text-decoration: none;">
<p style="margin-bottom: 0cm; text-decoration: none;">If you have not played with any of the aforementioned extensions, I suggest you give them a try. They can really improve your productivity and general understanding of internet technologies.</p>
]]></content:encoded>
			<wfw:commentRss>http://alistairjohnson.com.au/webmusings/?feed=rss2&amp;p=47</wfw:commentRss>
		</item>
		<item>
		<title>Form validation using javascript, liquid css layout, mysql search queries.</title>
		<link>http://alistairjohnson.com.au/webmusings/?p=41</link>
		<comments>http://alistairjohnson.com.au/webmusings/?p=41#comments</comments>
		<pubDate>Tue, 23 Sep 2008 06:21:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alistairjohnson.com.au/webmusings/?p=41</guid>
		<description><![CDATA[My project involves creating a hypothetical employment website where job advertisers can post job listings and job seekers can search the database of these listings using various search criteria.
]]></description>
			<content:encoded><![CDATA[<div>My project involves creating a hypothetical employment website where job advertisers can post job listings and job seekers can search the database of these listings using various search criteria.</div>
]]></content:encoded>
			<wfw:commentRss>http://alistairjohnson.com.au/webmusings/?feed=rss2&amp;p=41</wfw:commentRss>
		</item>
		<item>
		<title>Don&#8217;t Make Me Think - Steve Krug</title>
		<link>http://alistairjohnson.com.au/webmusings/?p=30</link>
		<comments>http://alistairjohnson.com.au/webmusings/?p=30#comments</comments>
		<pubDate>Mon, 22 Sep 2008 14:34:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[usability]]></category>

		<category><![CDATA[interface design]]></category>

		<guid isPermaLink="false">http://alistairjohnson.com.au/webmusings/?p=30</guid>
		<description><![CDATA[I&#8217;ve recently finished reading Steve Krug&#8217;s web usability book titled “Don&#8217;t make me think” and thoroughly enjoyed it. I thought I would share some of the points the author made that resonated with me most:
Common sense – much of web usability is just common sense. “Like a lot of common sense, though, it&#8217;s not necessarily [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0cm;">I&#8217;ve recently finished reading Steve Krug&#8217;s web usability book titled “Don&#8217;t make me think” and thoroughly enjoyed it. I thought I would share some of the points the author made that resonated with me most:</p>
<p style="margin-bottom: 0cm;"><strong>Common sense</strong> – much of web usability is just common sense. “Like a lot of common sense, though, it&#8217;s not necessarily obvious until after someone has pointed it out to you”. In a nutshell, web usability should be focused on ensuring that a person of average ability and experience should be able to use your site with minimal frustration.</p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;"><a href="http://alistairjohnson.com.au/webmusings/wp-content/uploads/2008/09/krug.jpg"><img class="size-full wp-image-31 alignleft" title="Don't Make me Think" src="http://alistairjohnson.com.au/webmusings/wp-content/uploads/2008/09/krug.jpg" alt="" width="216" height="216" /></a></p>
<p style="margin-bottom: 0cm;"><strong>Don&#8217;t make me think – </strong><span>this is Steve&#8217;s first rule of usability and is the overriding principle when deciding whether or not something works or doesn&#8217;t  in a web design. When a user looks at your page, it should be self-evident, obvious, self-explanatory. They should be able understand it without  expending much effort thinking about it.</span></p>
<p style="margin-bottom: 0cm;"><strong>Web users don&#8217;t read pages, they scan them – </strong><span>it is a well-documented fact that most web users tend to spend little time &#8216;reading&#8217; web pages. Instead, they scan them browsing for words, phrases or icons that draw their attention. </span></p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;"><strong>Users don&#8217;t make optimal choices. They take the first reasonable option – </strong><span>It&#8217;s best not to assume users will scan the page, consider all of the available options and choose the best one. In reality, users don&#8217;t choose the best option, they choose the first reasonable option. The reasons for this ? Web users are usually in a hurry, there&#8217;s not much penalty for guessing wrong and weighing the options may not improve our chances.</span></p>
<p style="margin-bottom: 0cm;"><span id="more-30"></span></p>
<p style="margin-bottom: 0cm;"><strong>Create a clear visual hierarchy – </strong><span>it is of paramount importance to make sure the visual cues clearly and accurately depict the relationship between the items on the page. The more important something is, the more prominent it should be. Things that are related logically should also be related visually. Things should be nested visually to show what&#8217;s part of what (eg a subcategory).</span></p>
<p style="margin-bottom: 0cm;"><strong>Conventions are your friends – </strong><span>the feeling of familiarity that user&#8217;s have when they are presented with a web convention is very reassuring. Well-applied conventions make it simpler for users to jump from site to site without wasting effort figuring out how things work.</span></p>
<p style="margin-bottom: 0cm;"><strong>Make it obvious what&#8217;s clickable – </strong><span>this is closely related to creating a clear visual hierarchy and will save the user many wasted mouse clicks.</span></p>
<p style="margin-bottom: 0cm;"><strong>Omit needless words – “</strong><span>a sentence should contain no unnecessary words, a paragraph no unnecessary sentences, for the same reason that a drawing should have no unnecessary lines and a machine no unnecessary parts”.  Don&#8217;t include words that are just taking up space and wasting the user&#8217;s valuable time ! Try to get rid of half the words on a page, then get rid of half of what&#8217;s left.</span></p>
<p style="margin-bottom: 0cm;"><span>There is much more to be gained from this book. The above points are just those that stuck with me most. “Don&#8217;t make me think” is highly recommended reading for anyone interested in web usability and interface design.</span></p>
<p style="margin-bottom: 0cm;"><strong>References</strong></p>
<ol>
<li>Krug, S. 2006, <em>Don&#8217;t Make Me Think : A common sense approach to web usability</em>, 2nd Edition, New Riders.<a href="http://www.useit.com/alertbox/screen_resolution.html"></a></li>
</ol>
<p style="margin-bottom: 0cm;">
]]></content:encoded>
			<wfw:commentRss>http://alistairjohnson.com.au/webmusings/?feed=rss2&amp;p=30</wfw:commentRss>
		</item>
		<item>
		<title>Layout Decisions - Fixed, Fluid or Elastic ?</title>
		<link>http://alistairjohnson.com.au/webmusings/?p=25</link>
		<comments>http://alistairjohnson.com.au/webmusings/?p=25#comments</comments>
		<pubDate>Tue, 26 Aug 2008 07:02:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[css]]></category>

		<category><![CDATA[elastic]]></category>

		<category><![CDATA[fixed]]></category>

		<category><![CDATA[fluid]]></category>

		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://alistairjohnson.com.au/webmusings/?p=25</guid>
		<description><![CDATA[When you commence the planning of a web project, many of your first design decisions  will be related to your page layout. Essentially, you will need to decide to incorporate one (or any combination) of the following design styles:


Fixed width - A fixed-width design is one in which the widths of the pages elements [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0cm;">When you commence the planning of a web project, many of your first design decisions  will be related to your page layout. Essentially, you will need to decide to incorporate one (or any combination) of the following design styles:</p>
<p style="margin-bottom: 0cm;">
<ul>
<li><strong>Fixed width - </strong><span>A fixed-width design is one in which the widths of the pages elements and various components are defined in an absolute unit of measurement (almost always pixels). The main characteristic of such pages is that the user cannot adjust the width of the page elements, either by resizing the browser window or by changing the text size. Despite this, fixed-width layouts are still the most common in practice.</span></li>
</ul>
<ul>
<li><strong>Liquid –</strong><span> a liquid (or fluid) design is characterised by the width of all page components being specified as a percentage of the user&#8217;s viewport width. In other words, liquid layouts scale in relation to the browser window. If the user makes their window wider or narrower, the design will adapt. </span></li>
</ul>
<ul>
<li><strong>Elastic – </strong><span>an elastic design works by setting the widths of page elements relative to font size rather than browser width. This layout will expand or shrink as the reader changes their text size, but will remain unaffected by any changes in the user&#8217;s browser window size.</span></li>
</ul>
<ul>
<li><strong>Hybrid – </strong><span>any combination of the aforementioned layout styles.</span></li>
</ul>
<p style="margin-bottom: 0cm;"><span>There is a plethora of detailed material on the web that gives detailed descriptions of the disadvantages and advantages of each design style. Instead of reproducing that here, I aim to give a succinct summary of what I consider to be the pros and cons of each method.</span></p>
<p style="margin-bottom: 0cm;"><span id="more-25"></span></p>
<p style="margin-bottom: 0cm;"><strong>Fixed width:</strong></p>
<p style="margin-bottom: 0cm;">Pros</p>
<ul>
<li>
<p style="margin-bottom: 0cm;">Developer more control over layout 	and positioning.</p>
</li>
</ul>
<p style="margin-bottom: 0cm;">Cons</p>
<ul>
<li>
<p style="margin-bottom: 0cm;">Doesn&#8217;t make good use of available 	space. On large resolutions, designs created for 800 x 600 screens 	can appear tiny and lost in the middle of the screen. Conversely, a 	design created for a 1024 x 768 screen will cause horizontal 	scrolling on smaller screen resolutions.</p>
</li>
<li>
<p style="margin-bottom: 0cm;">Line lengths and legibility. Fixed 	width layouts usually work well with the browser default text size. 	However, you only have to increase the text size a couple of steps 	before sidebars start running out of space and the line lengths get 	too short to comfortably read.</p>
</li>
</ul>
<ul>
<li>when the reader increases the text size, the text will sooner or later may break out of a narrow column and lead to an overlap that can render the page unreadable.</li>
</ul>
<p style="margin-bottom: 0cm;"><strong>Liquid Layouts:</strong></p>
<p style="margin-bottom: 0cm;">Pros</p>
<ul>
<li>very efficient 	use of space.</li>
</ul>
<ul>
<li>the reader 	will never have to scroll sideways, 	regardless of his or her monitor size.</li>
</ul>
<p>Cons</p>
<ul>
<li>At small 	window widths, line lengths can get incredibly narrow and difficult 	to read. However, you can use the min-width css property to prevent 	the layout from becoming too narrow.</li>
</ul>
<ul>
<li>
<p style="margin-bottom: 0cm;">At large 	window widths (on large resolutions), line lengths can become long 	and difficult to read. There is a max-width css property but 	unfortunately ie6 does not support it and ie6 is still too popular a 	browser to ignore. There are other more complicated potential 	solutions that exist.</p>
</li>
</ul>
<ul>
<li>
<p style="margin-bottom: 0cm;">more time and 	effort involved (and more difficult to get consistent results across 	browsers)</p>
<p style="margin-bottom: 0cm;">
</li>
</ul>
<p style="margin-bottom: 0cm;"><strong>Elastic Layouts:</strong></p>
<p style="margin-bottom: 0cm;">Pros</p>
<ul>
<li>
<p style="margin-bottom: 0cm;">Solve the 	problem of line lengths becoming uncomfortably long or short</p>
</li>
</ul>
<p style="margin-bottom: 0cm;">Cons</p>
<ul>
<li>
<p style="margin-bottom: 0cm;">Layout can 	become wider than the browser window, forcing the appearance of 	horizontal scroll bars.</p>
</li>
</ul>
<ul>
<li>
<p style="margin-bottom: 0cm;"><span>more 	time and effort involved (and more difficult to get consistent 	results across browsers)</span></p>
</li>
</ul>
<p style="margin-bottom: 0cm;"><strong>Hybrid</strong></p>
<p style="margin-bottom: 0cm;">Pros</p>
<ul>
<li>
<p style="margin-bottom: 0cm;">can utilise 	the advantages of each method it uses.</p>
</li>
</ul>
<p style="margin-bottom: 0cm;">Cons</p>
<ul>
<li>
<p style="margin-bottom: 0cm;">introduces 	the disadvantages of each method incorporated</p>
</li>
</ul>
<ul>
<li>
<p style="margin-bottom: 0cm;">difficult to 	implement</p>
</li>
</ul>
<ul>
<li>
<p style="margin-bottom: 0cm;">certain 	issues can present themselves. For example, if a portion of your page uses 	fixed-width layout and another portion uses an elastic layout, you 	may get undesirable results when the user increases or decreases 	their text size.</p>
</li>
</ul>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm;">In my opinion, if you can justify the extra time and effort required to build a liquid or elastic design, there are significant usability benefits evident. Just be prepared for some long nights, with plenty of coffee as you become acquainted with some glorious browser inconsistencies never encountered before.</p>
<p style="margin-bottom: 0cm;"><strong>References</strong></p>
<p style="margin-bottom: 0cm;"><a title="http://www.alistapart.com/articles/doctype/" href="http://www.alistapart.com/articles/doctype/" target="_blank"></a></p>
<ol>
<li>Jakob Nielsen 2006, <em>Screen Resolution and Page Layout</em>, 26/8/2008, <a href="http://www.useit.com/alertbox/screen_resolution.html">http://www.useit.com/alertbox/screen_resolution.html</a></li>
<li>
<div class="ishinfo">Patrick Griffiths 2004, <em>Elastic Design</em>, A list Apart, 26/8/2008, <a href="http://www.alistapart.com/articles/elastic">http://www.alistapart.com/articles/elastic</a></div>
</li>
<li>Tommy Olsson 2004, <em>Fixed vs Liquid vs Elastic</em>, 26/8/2008, <a href="http://www.autisticcuckoo.net/archive.php?id=2004/07/21/fixed-liquid-elastic">http://www.autisticcuckoo.net/archive.php?id=2004/07/21/fixed-liquid-elastic</a></li>
<li>Andy Clarke 2004, <em>Fixed or Fluid you decide</em>, 26/8/2008, <a href="http://www.stuffandnonsense.co.uk/archives/fixed_or_fluid_you_decide.html">http://www.stuffandnonsense.co.uk/archives/fixed_or_fluid_you_decide.html</a></li>
<li>Budd, A. 2006, <em>CSS Mastery Advanced Web Standards Solutions</em>, 1st Edition, Friends of Ed.</li>
</ol>
<p style="margin-bottom: 0cm;"><a href="http://www.useit.com/alertbox/screen_resolution.html"><br />
</a></p>
<p style="margin-bottom: 0cm;"><a href="http://www.alistapart.com/articles/elastic"><br />
</a></p>
<p style="margin-bottom: 0cm;"><a href="http://www.stuffandnonsense.co.uk/archives/fixed_or_fluid_you_decide.html"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://alistairjohnson.com.au/webmusings/?feed=rss2&amp;p=25</wfw:commentRss>
		</item>
		<item>
		<title>Doctype Declarations - First thing in the page, yet often overlooked.</title>
		<link>http://alistairjohnson.com.au/webmusings/?p=1</link>
		<comments>http://alistairjohnson.com.au/webmusings/?p=1#comments</comments>
		<pubDate>Sat, 16 Aug 2008 01:58:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[HTML]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[doctype]]></category>

		<category><![CDATA[DTD]]></category>

		<guid isPermaLink="false">http://alistairjohnson.com.au/webmusings/?p=1</guid>
		<description><![CDATA[Considering this is my first post, i thought what better way to start than with the first element on a typical html page, the doctype declaration (usually referred to as the shorthand &#8216;DOCTYPE&#8217;). Most designers and developers would admit to simply cutting and pasting this crucial snippet of code from an external source without understanding [...]]]></description>
			<content:encoded><![CDATA[<p>Considering this is my first post, i thought what better way to start than with the first element on a typical html page, the doctype declaration (usually referred to as the shorthand &#8216;DOCTYPE&#8217;). Most designers and developers would admit to simply cutting and pasting this crucial snippet of code from an external source without understanding its true meaning or purpose. It is beneficial to have a basic understanding of the DOCTYPE because it can be the source of rendering issues and is often the last place you would look to rectify a problem.  A DOCTYPE essentially informs the browser as to which <strong>Document Type Definition</strong> <strong>(DTD)</strong> you intend your markup to conform to. A DTD being a specification of the rules and guidelines as to the structure of the markup you write.</p>
<div id="attachment_19" class="wp-caption alignright" style="width: 210px"><a href="http://alistairjohnson.com.au/webmusings/wp-content/uploads/2008/08/doctypes.gif"><img class="size-full wp-image-19" title="doctypes" src="http://alistairjohnson.com.au/webmusings/wp-content/uploads/2008/08/doctypes.gif" alt="doctypes" width="200" height="228" /></a><p class="wp-caption-text">DOCTYPE options</p></div>
<p>In terms of web standards, a DOCTYPE  informs the validator which version of (X)HTML you’ve incorporated, and must appear at the top of every page. DOCTYPEs are an essential component of standards compliant web pages: your markup and CSS will simply not validate without them.</p>
<p>In fact, using an incorrect/incomplete DOCTYPE - or no DOCTYPE at all - leads many browsers to render your page in a so-called &#8220;Quirks&#8221; mode. Essentially, in this event the browser assumes that you&#8217;ve written outdated, invalid markup characteristic of the late 90s. To cope with this, the browser will try to render your website in a backward-compatible mode, displaying it as it might have appeared in antiquated browsers such as IE4. This is usually not what you intend and will result in all kinds of problems.</p>
<p><span id="more-1"></span></p>
<h3><span style="text-decoration: underline;">The Anatomy of a doctype</span></h3>
<p>Lets take a look at a typical doctype declaration and examine each of its components in detail:</p>
<pre><strong>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
</strong></pre>
<ul>
<li>The <strong>&lt;!DOCTYPE html</strong> portion simply states that we are beginning a doctype declaration and that the html element is the root element of our page.</li>
</ul>
<ul>
<li>The word <strong>PUBLIC </strong>is referring to the fact that the DTD we&#8217;re referencing is publicy available</li>
</ul>
<ul>
<li>The string <strong><strong>&#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; </strong></strong>is an example of a <strong>Formal Public Identifier (FPI)</strong>. In a nutshell, this outlines details about the DTD and the organisation that owns it (in this case the <strong>W3C</strong>). The inclusion of <strong>EN </strong>means that the language of the DTD is english in this case.</li>
</ul>
<ul>
<li>Lastly, the URL of <strong><strong>&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221; </strong></strong>points to the location of the DTD.</li>
</ul>
<h3><span style="text-decoration: underline;">Available doctypes</span></h3>
<p>XHTML 1.0 specifies three XML document types for us to use: <strong>Strict</strong>, <strong>Transitional</strong>, and <strong>Frameset</strong>.</p>
<pre><strong>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
</strong></pre>
<pre><strong>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
</strong></pre>
<pre><strong>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
</strong></pre>
<ul>
<li><strong>Strict DTD</strong> - should be used when you want clean markup that is absent of any tags or attributes that exist for presentational purposes. That is, you are able to confine all presentational facets of your page to your CSS.</li>
<li><strong>Transitional DTD - </strong>should be utilised when you have no option but to use XHTML&#8217;s presentational features because your potential audience may use a browser that does not properly support modern CSS.</li>
<li><strong>Frameset DTD - </strong>should only be relied upon when you are using frames in the layout of your page.</li>
</ul>
<p>In summary, as standards-aware designers and developers we should be striving to use the strict doctype in all of our work. By validating a page with a strict doctype, we have the comfort of knowing we have properly seperated our structure (HTML) from our presentation layer (CSS). We should only be resorting to the transitional and frameset DTDs in exceptional circumstances. Cases such as supporting legacy pages written using frames, or a web page targeted at a mobile device browser that does not support modern day CSS.</p>
<p>I hope this has educated you somewhat in the importance of a correct DOCTYPE and that you can now view the top of your HTML pages in a different light.</p>
<h3><strong>References</strong></h3>
<ol>
<li>2008, HTML DOCTYPE TAG, W3C Schools, 15/8/2008, <a title=" http://www.w3schools.com/tags/tag_DOCTYPE.asp" href="http://www.w3schools.com/tags/tag_DOCTYPE.asp" target="_blank">http://www.w3schools.com/tags/tag_DOCTYPE.asp</a></li>
<li>Haine, P. 2006, <em>HTML Mastery Semantics, Standards, and Styling</em>, 1st Edition, Friends of Ed.</li>
<li>Jeffrey Zeldman 2002, <em>Fix Your Site With the RIght DOCTYPE!</em>, A list Apart, 15/8/2008, <a title="http://www.alistapart.com/articles/doctype/" href="http://www.alistapart.com/articles/doctype/" target="_blank">http://www.alistapart.com/articles/doctype/</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://alistairjohnson.com.au/webmusings/?feed=rss2&amp;p=1</wfw:commentRss>
		</item>
	</channel>
</rss>
