<?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>HTML5 Doctor &#187; div</title>
	<atom:link href="http://html5doctor.com/tag/div/feed/" rel="self" type="application/rss+xml" />
	<link>http://html5doctor.com</link>
	<description>helping you implement HTML5 today</description>
	<lastBuildDate>Wed, 16 May 2012 11:31:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Your Questions Answered #12</title>
		<link>http://html5doctor.com/your-questions-12/</link>
		<comments>http://html5doctor.com/your-questions-12/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 13:45:15 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2369</guid>
		<description><![CDATA[<p>The latest round of <abbr>HTML</abbr>5 prescriptions is in! This week, we'll briefly cover the <abbr>HTML</abbr>5 vs Flash debate, whether to use <code>&#60;body&#62;</code> or <code>&#60;div&#62;</code>, <abbr>HTML</abbr>5 rich text editors, and the <abbr>HTML</abbr>5 charset and doctype.</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://html5doctor.com/wp-content/uploads/2009/07/html5doctor-treatment.gif" alt="Doctor treating a patient illustration" class="alignright size-full wp-image-424" /> The latest round of <abbr>HTML</abbr>5 prescriptions is in! This week, we&#8217;ll briefly cover the <abbr>HTML</abbr>5 vs Flash debate, whether to use <code>&lt;body&gt;</code> or <code>&lt;div&gt;</code>, <abbr>HTML</abbr>5 rich text editors, and the <abbr>HTML</abbr>5 charset and doctype.</p>
<p>    <!-- more --></p>
<section>
<h2><abbr>HTML</abbr>5 vs Flash</h2>
<p>Yaniv opens the great debate:</p>
<blockquote>
<p>Hi, why is it said all the time that <abbr>HTML</abbr> 5 is going to replace Flash and in the near future flash will not be used again?</p>
</blockquote>
<p>This is over-simplifying.</p>
<p>Historically, Flash has been used especially for games, video, and rich interaction because it wasn’t possible to do these things natively (i.e., without using a plugin). <abbr>HTML</abbr>5 introduces <code>&lt;canvas&gt;</code> and a native <code>&lt;video&gt;</code> element, and recently JavaScript libraries like jQuery make it much easier to create rich interaction. An additional benefit of Flash was its ubiquity, but thanks to the iPhone and now iPad, this isn’t true anymore.</p>
<p>I expect the usage of Flash to decrease as browsers support web standards, but Flash will still be used for a while to come. The enormous number of pages using Flash aren’t going to vanish (or change) overnight.</p>
<p>Peace &#8211; Oli</p>
</section>
<section>
<h2>Body or div?</h2>
<p>Erik asked:</p>
<blockquote>
<p>Hi there, I have noticed that several implementations of <abbr>HTML</abbr>5 (including this blog), set a width of the body rather than using a wrapping div-tag to create a centered layout.</p>
<p>It somehow feels awkward to set a width of the body, but is that the actual, proper way of doing it? I understand that a wrapping div is non-semantic, but how would one deal with background images etc, if the body has a width set to it? I&#8217;m guessing it would work to set background images on the html-tag, as well, though.</p>
</blockquote>
<p>If you need a <code>&lt;div&gt;</code> for styling purposes, that&#8217;s perfectly fine. You could also achieve the same effect by doing as you suggest and setting a background on the <code>&lt;html&gt;</code> element. For more, take a look at our recent article <a href="http://html5doctor.com/you-can-still-use-div/">You can still use <code>&lt;div&gt;</code></a>.</p>
<p>If you need any help on using <code>&lt;body&gt;</code> as a wrapper, check out Kroc Camen&#8217;s <a href="http://camendesign.com/developpeurs_sans_frontieres">How to Centre and Layout Pages Without a Wrapper</a>.</p>
<p>Peace &#8211; Oli</p>
</section>
<section>
<h2>Rich text editor</h2>
<p>Dave asked:</p>
<blockquote>
<p>We use our own bespoke <abbr>CMS</abbr> and part of the admin has a Javascript based rich-text editor (ck editor i think)for editing the main content of the pages.</p>
<p>The problem we&#8217;ve come across is that I&#8217;m building the site in <abbr>HTML</abbr>5 and it appears the text editor doesn&#8217;t recognise the new <abbr>HTML</abbr>5 tags (section, aside, article etc.) Do you know of any text editor that can handle <abbr>HTML</abbr>5 as I can’t seem to find anything in terms of Javascript based components or any other alternative. Many Thanks</p>
</blockquote>
<p>Generally, JavaScript-based <abbr>WYSIWYG</abbr> editors are <strong>complete shite</strong> (excuse my British ;-). Unfortunately, I don&#8217;t think this is gonna change soon because the established players were developed in the bad old days and have the code baggage to prove it. Perhaps with <abbr>IE</abbr>9 someone will cut the support anchor on older versions of <abbr>IE</abbr> (Safari, etc) and actually do a decent one, but don’t hold your breath :-)</p>
<p>You can customise most editors, however, and possibly even add your own elements. As a start, here&#8217;s an article I wrote on <a href="http://boblet.tumblr.com/post/32491901/semantic-text-entry-for-mt4">hacking FCKEditor into some semblance of shape for <abbr>MT</abbr>4</a>.</p>
<p>Beyond that, the editor&#8217;s documentation and forums are the place to check.</p>
<p>In addition, migrating to <abbr>HTML</abbr>5 is not all-or-nothing. You can get benefits from just the doctype (better validator, more detailed spec). Also, <a href="http://html5doctor.com/you-can-still-use-div/" title="You can still use div | HTML5 Doctor"><code>&lt;div&gt;</code> is still a perfectly fine <abbr>HTML</abbr>5 element</a>. Should new structural elements overwhelm the editor, you can always do something like <code>&lt;div class="article"&gt;</code> and <code>&lt;div class="nav"&gt;</code> (so-called <abbr>HTML</abbr>4.5 ;-). This way you&#8217;re not using new elements, but you&#8217;re still benefitting from thinking in <abbr>HTML</abbr>5 semantics, and should you want to change down the road, you&#8217;ll already be half way there.</p>
<p>Peace &#8211; Oli</p>
</section>
<section>
<h2>Recommended charset for <abbr>HTML</abbr>5</h2>
<p>Guy asked:</p>
<blockquote>
<p>I have always used ISO-8859-1 as things like £ work better (being <abbr>UK</abbr> based)</p>
<p>But I have noticed a strong tendency for <abbr>UTF</abbr>-8 when it comes to <abbr>HTML</abbr>5. Is there a reason for this? what do you recommend?</p>
<p>Many thanks, Guy</p>
</blockquote>
<p>The <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset"><abbr>HTML</abbr>5 spec says use <abbr>UTF</abbr>-8</a>: “Authors are encouraged to use <abbr>UTF</abbr>-8”. The reason is <abbr>UTF</abbr>-8 is a superset of ISO-8859-1, and <a href="http://en.wikipedia.org/wiki/ISO/IEC_8859-1" title="ISO/IEC 8859-1 - Wikipedia, the free encyclopedia">can represent many more characters</a>. To get a £ symbol, you can write <code>&amp;#163;</code> (or <code>&amp;pound;</code>), but with <abbr>UTF</abbr>-8, just writing “£” is fine.</p>
<p>In fact, using <abbr>UTF</abbr>-8 in <abbr>HTML</abbr>5, we only need to escape &amp; and &lt; (and maybe &#8216;,&#8221;, and > depending on context — e.g., <code>alt</code> text). All other <abbr>UTF</abbr>-8 characters can be used as-is (e.g., “” not <code>&amp;ldquo;&amp;rdquo;</code>). Just look at the source for this paragraph!</p>
<p>Peace &#8211; Oli</p>
</section>
<section>
<h2>Mobile doctype</h2>
<p>Franceso asked:</p>
<blockquote>
<p>Hello guys! I was wondering, since I found no reference at all online&#8230; does the <abbr>HTML</abbr>5 doctype cause problems on mobile browsers (besides the iPhone/iPod/iPad. I tested it and it works like a charm)?</p>
<p>I don&#8217;t mean &#8220;advanced&#8221; <abbr>HTML</abbr>5 properties like <code>video</code> or even <code>article</code> and other semantic tags. Just the simple <abbr>HTML</abbr>5 doctype, that causes no problems whatsoever with classic desktop browsers. Because I tried it, and it does seem to cause layout problems on Symbian (the only other browser I could test it).</p>
<p>Any suggestions? Because I do use the <code>video</code> tag in there (to degrade gracefully in all mobile browsers but the iPhone&#8217;s, I&#8217;d hope), but I hate using that with the classic mobile <abbr>XHTML</abbr> doctype declaration. Thanks!</p>
</blockquote>
<p>The <abbr>HTML</abbr>5 doctype was chosen to be backward compatible with current browsers, and for desktop I think that&#8217;s completely true. I doubt many mobile browsers were tested, though. Anything not running Opera Mini or Mobile Webkit is most probably still partying like it&#8217;s 1999, and <abbr title="Your Mileage May Vary">YMMV</abbr>. I&#8217;d recommend testing thoroughly.</p>
<p>By the way, anything that doesn’t support the <abbr>HTML</abbr>5 doctype definitely will not support <code>&lt;video&gt;</code>. Hope that helps.</p>
<p>Peace &#8211; Oli</p>
</section>
<section>
<h2>Got a question for us?</h2>
<p>That wraps up this round of questions. If you&#8217;ve got a query about the <abbr>HTML</abbr>5 spec or how to implement it, you can <a href="http://html5doctor.com/ask-the-doctor/">get in touch</a> with us and we&#8217;ll do our best to help.</p>
</section>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/your-questions-answered-10/" rel="bookmark" class="crp_title">Your Questions Answered #10</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-1/" rel="bookmark" class="crp_title">Your questions answered #1</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-11/" rel="bookmark" class="crp_title">Your Questions Answered #11</a></li>
<li><a href="http://html5doctor.com/your-questions-14/" rel="bookmark" class="crp_title">Your Questions #14</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-2/" rel="bookmark" class="crp_title">Your questions answered #2</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/your-questions-12/" rel="bookmark">Your Questions Answered #12</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on August 12, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-12/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>You can still use div</title>
		<link>http://html5doctor.com/you-can-still-use-div/</link>
		<comments>http://html5doctor.com/you-can-still-use-div/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 13:30:37 +0000</pubDate>
		<dc:creator>Mike Robinson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1853</guid>
		<description><![CDATA[&#8220;Sorry, can you say that again?&#8221;, I hear you ask. Certainly: you can still use &#60;div&#62;! Despite HTML5 bringing us new elements like &#60;article&#62;, &#60;section&#62;, and &#60;aside&#62;, the &#60;div&#62; element still has its place. Let the HTML5 Doctor tell you why. Status: Unchanged In HTML 4, the &#60;div&#62; element was defined to be a generic [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Sorry, can you say that again?&#8221;, I hear you ask. Certainly: you can still use <code>&lt;div&gt;</code>! Despite <abbr title="HyperText Markup Language">HTML</abbr>5 bringing us new elements like <code>&lt;article&gt;</code>, <code>&lt;section&gt;</code>, and <code>&lt;aside&gt;</code>, the <code>&lt;div&gt;</code> element still has its place. Let the <abbr>HTML</abbr>5 Doctor tell you why.</p>
<p><span id="more-1853"></span></p>
<h2>Status: Unchanged</h2>
<p>In <abbr>HTML</abbr> 4, the <code>&lt;div&gt;</code> element was defined to be a generic element for structuring a page. Although you can allude to the nature of its content by assigning <code>id</code> and <code>class</code> attributes with meaningful names, a <code>&lt;div&gt;</code> has almost no semantic meaning. <a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">The <abbr>HTML</abbr>5 definition</a>is basically the same as in <abbr>HTML</abbr> 4:</p>
<blockquote>
<p>The div element has no special meaning at all. It represents its children. It can be used with the class, lang, and title attributes to mark up semantics common to a group of consecutive elements.</p>
<footer>
    <cite><a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">W3C Specification</a></cite><br />
  </footer>
</blockquote>
<p><code>&lt;div&gt;</code> is literally a container for flow content*, a collection of (hopefully) more semantically marked-up content that may need to be grouped together. It lies at the opposite end of the semantic spectrum from the new <abbr>HTML</abbr>5 structural elements.</p>
<p><small>* For those who haven&#8217;t encountered this term before, <a href="http://dev.w3.org/html5/spec/Overview.html#flow-content-0">flow content</a> elements are the same as <abbr>HTML</abbr> 4&#8242;s block-level content elements.</small></p>
<h2><code>&lt;div&gt;</code> vs semantic elements</h2>
<p>The new semantic elements (<code>&lt;article&gt;</code>, <code>&lt;section&gt;</code>, and friends) justifiably capture a lot of <code>&lt;div&gt;</code>&#8216;s territory, but <code>&lt;div&gt;</code> still has a place in the <abbr>HTML</abbr>5 world. You should use <code>&lt;div&gt;</code> when there is no other more semantically appropriate element that suits your purpose. Its most common use will likely be for stylistic purposes — i.e., wrapping some semantically marked-up content in a <abbr>CSS</abbr>-styled container.</p>
<p>Ask yourself questions about your content: Is it part of the site&#8217;s navigation? Is the content secondary to its surrounding content? If this content were printed on a page with nothing else, would it make sense? You will need to evaluate your content carefully, thinking about what it is and pairing it with an appropriate element. I recommend taking a look at <a href="http://html5doctor.com/happy-1st-birthday-us/">The Amazing <abbr>HTML</abbr>5 Doctor Easily Confused <abbr>HTML</abbr>5 Element Flowchart of Enlightenment</a> to help you choose the right element for your flow content.</p>
<h2>Example Uses</h2>
<p>Below are a few examples of how you can still use <code>&lt;div&gt;</code> appropriately in your <abbr>HTML</abbr>5 sites.</p>
<h3>Site Wrapper</h3>
<p>While you can <a href="http://camendesign.com/code/developpeurs_sans_frontieres">use the <code>&lt;body&gt; element</code></a> as a &#8220;natural&#8221; wrapper for site content, many people like to use <code>&lt;div&gt;</code> as top-level container for styling the entire site. This is an appropriate use of <code>&lt;div&gt;</code>, as a site wrapper has no meaning or purpose other than to aid styling.</p>
<pre><code>&lt;body&gt;
  &lt;div id="wrapper"&gt;
    &lt;header&gt;
      &lt;h1&gt;My Happy Blog&lt;/h1&gt;
      &lt;nav&gt;
        &lt;!-- ... --&gt;
      &lt;/nav&gt;
    &lt;/header&gt;

    &lt;!-- ... rest of site content ... --&gt;
  &lt;/div&gt;
&lt;/body&gt;</code></pre>
<h3>Intro paragraph</h3>
<p>If you want to style a particular block of content, like the intro to an article, <code>&lt;div&gt;</code> is a perfectly suitable element:</p>
<pre><code>&lt;article&gt;
  &lt;h1&gt;Big announcement&lt;/h1&gt;
  &lt;div class="intro"&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
    &lt;p&gt;Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&lt;/p&gt;
  &lt;/div&gt;
  &lt;p&gt;Sed massa metus, molestie nec facilisis non, lobortis ac orci. Suspendisse porttitor laoreet mi, at laoreet dolor rhoncus non. Sed ut massa quis mi placerat iaculis non sit amet odio. Cras tempus urna vitae felis rutrum porta.&lt;/p&gt;
  &lt;p&gt;Maecenas auctor lacus eget mauris tincidunt consectetur. Donec molestie malesuada ligula, sed feugiat massa consequat sit amet. Pellentesque orci metus, ultricies sit amet adipiscing eget, gravida fringilla dui. Vestibulum accumsan dui diam, eget venenatis urna. Sed eu lobortis justo. Aliquam erat volutpat. Aliquam erat volutpat.&lt;/p&gt;
&lt;/article&gt;</code></pre>
<p>The first two paragraphs aren&#8217;t really that different from the rest of the article, but by wrapping them in a <code>&lt;div&gt;</code>, they can be styled to capture the reader&#8217;s attention and draw them into the article. Of course, if you only want to style the first paragraph, you could use a <abbr>CSS</abbr> selector like <code>h1 + p {}</code> or <code>article p:first-child {}</code>. But if you want to style an article&#8217;s first paragraph only <em>sometimes</em>, or you need the style to work in older versions of Internet Explorer, or (as in this case) you want style more than one paragraph, a wrapper <code>&lt;div&gt;</code> is the way to go.</p>
<h3>Other uses for <code>&lt;div&gt;</code></h3>
<p>As previously stated, use of <code>&lt;div&gt;</code> will decline in favour of the new semantic elements. If you&#8217;re using lots of <code>&lt;div&gt;</code>s and only a few of the semantic elements in your <abbr>HTML</abbr>5 sites, then you&#8217;re really not taking advantage of what <abbr>HTML</abbr>5 has to offer.</p>
<p>That said, you may need to rely on <code>&lt;div&gt;</code> as you transition into the world of <abbr>HTML</abbr>5. For example, if many of your site&#8217;s visitors use Internet Explorer with JavaScript disabled, then you won&#8217;t be able to style the new elements for these users. A piece of advice we gave back in our article on <a href="http://html5doctor.com/how-to-use-html5-in-your-client-work-right-now/">how to use <abbr>HTML</abbr>5 in your client work right now</a> was to use <code>&lt;div&gt;</code> with classes named after the new semantic elements, getting you to think about how you would use the new semantic elements without actually using them.</p>
<pre><code>&lt;div class="article"&gt;
  &lt;div class="header"&gt;
    &lt;h1&gt;My blog post&lt;/h1&gt;
    &lt;p&gt;An example using divs with classes instead of the new elements.&lt;/p&gt;
  &lt;/div&gt;
  &lt;!-- ... content ... --&gt;
&lt;/div&gt;

&lt;article&gt;
  &lt;header&gt;
    &lt;h1&gt;My blog post&lt;/h1&gt;
    &lt;p&gt;The same article but switched to the new elements.&lt;/p&gt;
  &lt;/header&gt;
  &lt;!-- ... content ... --&gt;
&lt;/article&gt;</code></pre>
<p>This makes it simple to switch to the new elements when it becomes practical (think &#8220;search and replace&#8221;).</p>
<h2>Recap</h2>
<p>You will certainly use <code>&lt;div&gt;</code> less often in <abbr>HTML</abbr>5 than you did in <abbr>HTML</abbr> 4, but it&#8217;s still a valuable element to have in your toolkit. Sure, it&#8217;ll be picked last for the team because everyone else is better, but it&#8217;ll be the best damn generic container element there is!*</p>
<p>Look at the more semantically valuable elements and consider whether your content would benefit from what they offer. Need help deciding? Take a look at some of these articles right here on <abbr>HTML</abbr>5 Doctor:</p>
<ul>
<li><a href="http://html5doctor.com/the-header-element/">header</a></li>
<li><a href="http://html5doctor.com/the-footer-element/">footer</a></li>
<li><a href="http://html5doctor.com/aside-revisited/">aside</a></li>
<li><a href="http://html5doctor.com/the-article-element/">article</a></li>
<li><a href="http://html5doctor.com/the-section-element/">section</a></li>
<li><a href="http://html5doctor.com/the-figure-figcaption-elements/">figure</a></li>
<li><a href="http://html5doctor.com/nav-element/">nav</a></li>
</ul>
<p>For more, check our <a href="http://html5doctor.com/article-archive/">article archive</a>. And if all else fails, use a <code>&lt;div&gt;</code>!</p>
<p><small>* As it should be, it&#8217;s the only one apart from <code>&lt;span&gt;</code>. That said, if your content is just text, perhaps the oft-overlooked <code>&lt;p&gt;</code> would be more appropriate.</small>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/understanding-aside/" rel="bookmark" class="crp_title">Understanding aside</a></li>
<li><a href="http://html5doctor.com/aside-revisited/" rel="bookmark" class="crp_title">Aside Revisited</a></li>
<li><a href="http://html5doctor.com/the-details-and-summary-elements/" rel="bookmark" class="crp_title">The details and summary elements</a></li>
<li><a href="http://html5doctor.com/the-header-element/" rel="bookmark" class="crp_title">The header element</a></li>
<li><a href="http://html5doctor.com/the-hgroup-element/" rel="bookmark" class="crp_title">The hgroup element</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/you-can-still-use-div/" rel="bookmark">You can still use div</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 13, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/you-can-still-use-div/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Your Questions Answered #7</title>
		<link>http://html5doctor.com/your-questions-answered-7/</link>
		<comments>http://html5doctor.com/your-questions-answered-7/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:10:51 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[aside]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[hgroup]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[section]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1584</guid>
		<description><![CDATA[Here we are again with another round up of  patient questions about <abbr>HTML</abbr>5. In this article, we'll be covering a host of topics including <abbr>AJAX</abbr>, the eternal question of <code>div</code> or <code>section</code>, how to markup multiple blocks of content in a sidebar and using <code>header</code> with <code>hgroup</code>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://html5doctor.com/wp-content/uploads/2009/07/html5doctor-treatment.gif" alt="Doctor treating a patient illustration" class="alignright size-full wp-image-424" /> Here we are again with another round of patient questions about <abbr>HTML</abbr>5. In this article, we&#8217;ll be covering AJAX, the eternal question of <code>&lt;div&gt;</code> or <code>&lt;section&gt;</code>, our old friend Internet Explorer, how to mark up multiple blocks of content in a sidebar, and using <code>&lt;header&gt;</code> with <code>&lt;hgroup&gt;</code>.</p>
<h2><abbr>HTML</abbr> and AJAX</h2>
<p>Arie asked:</p>
<blockquote><p>I&#8217;m still learning about <abbr>html</abbr>5 and javascript, I&#8217;m wondering how <abbr>html</abbr>5 makes doing a lot of the things currently done in ajax and javascript more simple.  Is it by providing things like the canvas that unify ideas?</p>
</blockquote>
<p>Certain parts of <abbr>HTML</abbr>5 will indeed simplify or reduce the need for JavaScript. One such area of improvement is Web Forms 2.0, which will handle client-side form validation in the browser and provide new input types (like <code>&lt;input type="email"&gt;</code> that checks for a valid email address). Of course, you&#8217;ll still need to validate your forms on the server, but at least the browser will catch the most obvious mistakes before the user actually submits the form.</p>
<p>Other parts of <abbr>HTML</abbr>5, like <a href="http://html5doctor.com/introducing-web-sql-databases/">Web SQL Databases</a> and <code>&lt;canvas&gt;</code>, are essentially JavaScript <abbr>API</abbr>s. They may not cut down on your need for JavaScript, but they do provide a consistent interface to some powerful functionality and will enable your application or site to do more things within (or outside of) the browser.</p>
<p>Cheers, Rich</p>
<h2><code>&lt;div&gt;</code> or <code>&lt;section&gt;</code>?</h2>
<p>Paul asked:</p>
<blockquote><p>Hello</p>
<p>I see you are using divs on your website, I thought divs should be replaced by more semantic tags such as sections or article. what did I miss?</p>
<p>Thanks</p>
</blockquote>
<p>Hi Paul,</p>
<p>Just like with <abbr>HTML</abbr>4, you shouldn&#8217;t use <code>&lt;div&gt;</code>s or <code>&lt;span&gt;</code>s where another, more precise element would fit the bill. But for grouping arbitrary content, <code>&lt;div&gt;</code>s and <code>&lt;span&gt;</code>s remain the way to go.</p>
<p>Thanks, Bruce</p>
<h2><abbr>HTML</abbr>5 and <abbr>IE</abbr>6</h2>
<p>Adam asked:</p>
<blockquote><p>Greetings HTML5 Doctor,</p>
<p>Is it at all possible to have a <abbr>HTML</abbr>5 layout while 30% of our users are running <abbr>IE</abbr>6? We are an <abbr>IT</abbr> company and our website is very large so having separate versions is completely impractical. <abbr>HTML</abbr>5 would allow us to move on and keep our markup a lot simpler but with no concrete guarantees regarding universal support is <abbr>HTML</abbr>5 ever going to get off the ground within 5 years while not having to resort to javascript solutions?</p>
</blockquote>
<p>Simply change the doctype and you&#8217;ll be writing <abbr>HTML</abbr>5! If you want to use new elements, however, you&#8217;ll need to use JavaScript to support them (for all versions of <abbr>IE</abbr> up to <abbr>IE</abbr>8). The best place to start? Read <a href="http://html5doctor.com/author/remys/">Remy&#8217;s</a> article on <a href="http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/">How to get <abbr>HTML</abbr>5 working in <abbr>IE</abbr> and Firefox 2</a>.</p>
<p>I think we&#8217;re in a position to do something about this. By using the new doctype, block-level links, and new form input types (that degrade gracefully), we can start promoting <abbr>HTML</abbr>5 <em>right now</em>.</p>
<p>Cheers, Rich</p>
<h2>Multiple blocks in a sidebar</h2>
<p>Bart asked:</p>
<blockquote><p>On my page (revora.net) I have a sidebar with content that I deem appropriate for the <code>aside</code> element. The sidebar contains several blocks of content. I&#8217;ve currently made the whole bar <code>aside</code> and made the blocks <code>div</code>. Is this correct, or should I do it the other way around?</p>
</blockquote>
<p>It sounds like your first approach is correct. The <code>&lt;div&gt;</code>s might be <code>&lt;section&gt;</code>s or maybe <code>&lt;nav&gt;</code> elements though, depending on their content. I suggest you read our article (and the comments) on <a href="http://html5doctor.com/aside-revisited/">the <code>&lt;aside&gt;</code> element</a>.</p>
<p>Thanks, Tom</p>
<h2>Header with <code>&lt;hgroup&gt;</code></h2>
<p>Diego asked:</p>
<blockquote><p>Hi,</p>
<p>This structure is right?</p>
<pre><code>&lt;section id="choose-tip"&gt;
   &lt;header&gt;
       &lt;hgroup&gt;
           &lt;h1&gt;Foo Bar&lt;/h1&gt;
           &lt;h2&gt;Baz Bat Qux&lt;/h2&gt;
       &lt;/hgroup&gt;
   &lt;/header&gt;
   &lt;p&gt;lorem ipsum&lt;/p&gt;
&lt;/section&gt;</code></pre>
<p>What I mean is, if I have a HEADER with just 2 H(n) I need to put these into a HGROUP ? Or&#8230; I can remove the HEADER and leave just a HGROUP? What&#8217;s the better solutions for it?</p>
<p>Thanks for all,</p>
<p>Diego Tres</p>
</blockquote>
<p>What you have is correct. Basically, in the document outline, you will only see &#8220;Foo Bar&#8221; as the heading for that section. &#8220;Baz Bat Qux&#8221; will be hidden from the outline.</p>
<p>You don&#8217;t <em>have</em> to use a <code>&lt;header&gt;</code> within your <code>&lt;section&gt;</code> or an <code>&lt;hgroup&gt;</code> within your <code>&lt;header&gt;</code>. Similarly, you don&#8217;t <em>have</em> to use a <code>&lt;header&gt;</code> around your <code>&lt;hgroup&gt;</code>.</p>
<p>To summarise, the best solution (if you don&#8217;t require the <code>&lt;h2&gt;</code> to appear in the document outline) is what you&#8217;ve already got.</p>
<p>Cheers, Rich</p>
<h2>Got a question for us?</h2>
<p>That wraps up this round of questions! If you&#8217;ve got a query about the <abbr>HTML</abbr>5 spec or how to implement it, you can <a href="http://html5doctor.com/ask-the-doctor/">get in touch</a> with us and we&#8217;ll do our best to help.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/your-questions-5/" rel="bookmark" class="crp_title">Your Questions Answered #5</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-11/" rel="bookmark" class="crp_title">Your Questions Answered #11</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-6/" rel="bookmark" class="crp_title">Your Questions Answered #6</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-9/" rel="bookmark" class="crp_title">Your Questions Answered 9</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/your-questions-answered-7/" rel="bookmark">Your Questions Answered #7</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on April 20, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-7/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

