<?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>WebProNews &#187; XHTML2</title>
	<atom:link href="http://www.webpronews.com/tag/xhtml2/feed" rel="self" type="application/rss+xml" />
	<link>http://www.webpronews.com</link>
	<description>Breaking News in Tech, Search, Social, &#38; Business</description>
	<lastBuildDate>Sun, 12 Feb 2012 21:44:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How XHTML 2 Handles Headings</title>
		<link>http://www.webpronews.com/how-xhtml-2-handles-headings-2005-04</link>
		<comments>http://www.webpronews.com/how-xhtml-2-handles-headings-2005-04#comments</comments>
		<pubDate>Wed, 20 Apr 2005 18:12:12 +0000</pubDate>
		<dc:creator>Philipp Lenssen</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML2]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=17087</guid>
		<description><![CDATA[<p>One thing I like about the upcoming <a href="http://www.w3.org/TR/2004/WD-xhtml2-20040722/">XHTML 2</a> is the way it handles headings. Anyone who ever touched HTML knows a heading is written as &#60;h1&#62;...&#60;/h1&#62;, &#60;h2&#62;...&#60;/h2&#62; and so on.<br /><br /><img width="400" height="72" src="http://blogoscoped.com/files/xhtml2.gif" alt="" /></p>]]></description>
			<content:encoded><![CDATA[<p>One thing I like about the upcoming <a href="http://www.w3.org/TR/2004/WD-xhtml2-20040722/">XHTML 2</a> is the way it handles headings. Anyone who ever touched HTML knows a heading is written as &lt;h1&gt;&#8230;&lt;/h1&gt;, &lt;h2&gt;&#8230;&lt;/h2&gt; and so on.</p>
<p><img width="400" height="72" src="http://blogoscoped.com/files/xhtml2.gif" alt="" /></p>
<p>&nbsp;This goes down to &quot;h6&quot; and indicates the level (importance) of the heading. It is always good to start with h1, and then go down, so that you won&#8217;t have a document with an h3 where there is no h2, and so on (ISO-HTML even makes this mandatory).</p>
<p>If you ever need more than 6 levels of headings, you&#8217;ve hit a limit in HTML. But there was another problem as well: if you have a server-side scripting language such as PHP or Python, and different modules churn out different HTML fragments, you would always need to know the level you&#8217;re in and adjust heading depth accordingly (I&#8217;m doing this with my blogging software as well, and writing posts I always need to remind myself of the current heading level I&#8217;m in). This also prevents easy copy &amp; paste of HTML fragments which contain headings, as their level would need to be adjusted within the context of the new document. As a small additional annoyance with regular HTML headings, you&#8217;ve often found yourself repeating the document title in the h1 as well (rather redundant).</p>
<p>In XHTML2, on the other hand, these problems have been solved. Now there is <strong>a more general &quot;h&quot; element</strong>. It works like this:</p>
<pre>
&lt;h&gt;My Life&lt;/h&gt;

&lt;p&gt;I was born in ...&lt;/p&gt;</pre>
<p>And if you need a deeper heading, you will wrap the content with a &quot;section&quot; element:</p>
<pre>
&lt;h&gt;My Life&lt;/h&gt;

&lt;section&gt;

    &lt;h&gt;My childhood&lt;/h&gt;
    &lt;section&gt;
        &lt;h&gt;My toys&lt;/h&gt;
        &lt;p&gt;I had a teddy bear ...&lt;/p&gt;

        &lt;h&gt;My candy&lt;/h&gt;

    &lt;/section&gt;

    &lt;h&gt;My youth&lt;/h&gt;

    &lt;p&gt;...&lt;/p&gt;

&lt;/section&gt;</pre>
<p>The more section elements surrounding an &quot;h&quot; (the deeper it is nested), the lower its importance &ndash; and the higher its &quot;h&quot; number in terms of old HTML (h1 has no section, h2 has one section, h3 has two sections surrounding it and so on).</p>
<p>Can you still access this via stylesheets? The direct &quot;h2&quot; or &quot;h3&quot; doesn&#8217;t work, naturally. What does work however is making use of cascadance:</p>
<pre>
h
{
    /* some style */
}

section h
{
    /* some more style */
}

section section h
{
    /* some more style */
}</pre>
<p>In other words, a simple &quot;h&quot; gets a specific style; an &quot;h&quot; within a section another; an &quot;h&quot; within a section within a section another, and so on. As bonus, all lower elements will automatically be styled as well &ndash; the &quot;section section h&quot; selector covers nestings of two levels <em>and higher</em>.</p>
<p>To avoid repeating the title of a document in the h1, as is often done, XHTML 2 now allows the following:</p>
<pre>
    &lt;h property=&quot;title&quot;&gt;My life&lt;/h&gt;</pre>
<p><a href="http://blogoscoped.com/forum/7735.html">Comments</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/how-xhtml-2-handles-headings-2005-04/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 1/11 queries in 0.005 seconds using memcached
Object Caching 190/210 objects using memcached

Served from: webpronews.com @ 2012-02-12 16:44:46 -->
