<?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>CSSGURU.DE &#187; HTML5</title>
	<atom:link href="http://www.cssguru.de/category/html5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cssguru.de</link>
	<description>Ein weiteres tolles WordPress-Blog</description>
	<lastBuildDate>Tue, 24 Aug 2010 19:28:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTML 5 Layout</title>
		<link>http://www.cssguru.de/html-5-layout/</link>
		<comments>http://www.cssguru.de/html-5-layout/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 11:32:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://www.cssguru.de/?p=169</guid>
		<description><![CDATA[Die Arbeit am HTML 5 ist zwar noch nicht abgeschlossen, da es aber von dem W3C-Konsortium vorgestellt und schon von den modernen Browsern unterstützt wird, werde ich in diesem Artikel zeigen wie man ein Seitenlayout mit HTML 5 erstellt.

Als Vorlage werde ich ein einfaches Design wie dieses hier verwenden:

Das HTML 5 Grundgerüst sieht dann wie [...]]]></description>
			<content:encoded><![CDATA[<p>Die Arbeit am HTML 5 ist zwar noch nicht abgeschlossen, da es aber von dem W3C-Konsortium vorgestellt und schon von den modernen Browsern unterstützt wird, werde ich in diesem Artikel zeigen wie man ein Seitenlayout mit HTML 5 erstellt.<br />
<span id="more-169"></span><br />
Als Vorlage werde ich ein einfaches Design wie dieses hier verwenden:</p>
<p><img src="http://www.cssguru.de/wp-content/uploads/html5design.png" alt="html5design" title="html5design" width="480" height="255" class="alignnone size-full wp-image-170" /></p>
<p>Das HTML 5 Grundgerüst sieht dann wie folgt aus:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> <span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;de&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">charset</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;utf-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>HTML5 Layout<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/main.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
  ...
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>Bis auf den Doctype sieht die Synthax eigentlich nicht viel anders aus als bei einem XHTML/HTML 4 Document.<br />
Um mit der Umsetzung des Layouts weiter zu machen, habe ich noch eine kleine Grafik erstellt, um die Synthax von HTML 5 besser darzustellen:</p>
<p><img src="http://www.cssguru.de/wp-content/uploads/html5struktur.png" alt="html5struktur" title="html5struktur" width="480" height="226" class="alignnone size-full wp-image-175" /></p>
<p>Jetzt kommt die Struktur:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;doc&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;header <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>HTML5 Layout<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
    <span style="color: #009900;">&lt;nav&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;active&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Home<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Link1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Link2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>nav&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>header&gt;</span>
  <span style="color: #009900;">&lt;section <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;article&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Artikel Überschrift<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorum ipsum...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>article&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>section&gt;</span>
  <span style="color: #009900;">&lt;aside&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Sidebar<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorum ipsum...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>aside&gt;</span>
  <span style="color: #009900;">&lt;footer&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Impressum<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>footer&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>Wie man eindeutig erkennen kann, bekommt die HTML 5 Struktur mehr Symantik. Die einzelnen Elemente wie z.b. Header, Navigation, Sidebar usw. bekommen endlich eigene Tags was auch zu einem schlankerem Code führt. Das eine &#8220;div&#8221; wird verwendet, um dem Layout eine feste Breite zu verschaffen und um alles zu zentrieren.</p>
<p>Damit jetzt alles Form und Farbe bekommt folgt nun das CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* HTML5 HACK -------------------------------------- */</span>  
header<span style="color: #00AA00;">,</span> section<span style="color: #00AA00;">,</span> footer<span style="color: #00AA00;">,</span> aside<span style="color: #00AA00;">,</span> nav<span style="color: #00AA00;">,</span> article <span style="color: #00AA00;">&#123;</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;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* LAYOUT ------------------------------------------ */</span>
&nbsp;
body <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span>;
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span>;
  font-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#444</span>;
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Verdana<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span>;
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> 0;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> 0;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#doc</span>  <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">800px</span>;
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> 0 <span style="color: #993333;">auto</span>;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* HEADER &amp; NAVIGATION ------------------------------ */</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333</span>;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> 0 <span style="color: #933;">15px</span>;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> h1 <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> 0;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span> 0;
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#A5A5A5</span>;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> nav ul <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span>;
  <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span>;
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> 0;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> 0;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> nav ul li <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span>;
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> 0;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> 0;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> nav ul li a <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span>;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #933;">10px</span>;
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span>;
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#CC3366</span>;
  <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span>;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> nav ul li<span style="color: #6666ff;">.active</span> a<span style="color: #00AA00;">,</span>
<span style="color: #cc00cc;">#header</span> nav ul li a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span>;
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#444</span>;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* CONTENT ------------------------------------------ */</span>
&nbsp;
<span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">440px</span>;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> 0 <span style="color: #933;">15px</span>;
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> 0 0 <span style="color: #933;">10px</span> 0;
  <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;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* SIDEBAR ------------------------------------------ */</span>
&nbsp;
aside <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span>;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> 0 <span style="color: #933;">15px</span>;
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> 0 0 <span style="color: #933;">10px</span> 0;
  <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;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* FOOTER ------------------------------------------ */</span>
&nbsp;
footer <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span>;
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#DDD</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: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">15px</span>;
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> 0 0 0;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
footer a <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#999</span>;
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Am Anfang des CSS Files befindet sich ein kleiner Hack, damit sich die HTML 5 Elemente (header, section, footer, aside usw.) wie ganz normale Block-Level-Elemente verhalten. Wie es auch bei einem &#8220;div&#8221; der Fall ist.<br />
Das komplette Ergebniss aus HTML und CSS kan man <strong><a href="../wp-content/uploads/html5/">hier</a></strong> sehen.</p>
<p>Wie schon oben erwähnt befindet sich HTML 5 noch in der Entwicklung und wird zur Zeit leider in nur wenigen Browsern unterstützt. Für den IE gibts halt wie immer Workarounds. Es ist aber gut das man jetzt schon mit HTML 5 arbeiten kann.</p>
<p>Mehr Informationen gibts hier (english):<br />
<a href="http://dev.w3.org/html5/spec/Overview.html">http://www.w3.org</a><br />
<a href="http://html5doctor.com/">http://html5doctor.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssguru.de/html-5-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
