<?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>css-image.com</title>
	<atom:link href="http://css-image.com/resources/feed/" rel="self" type="application/rss+xml" />
	<link>http://css-image.com/resources</link>
	<description></description>
	<lastBuildDate>Sun, 14 Mar 2010 08:20:48 +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>Simple Website Layout Tutorial Using HTML5 and CSS3</title>
		<link>http://css-image.com/resources/2010/03/simple-website-layout-tutorial-using-html5-and-css3/</link>
		<comments>http://css-image.com/resources/2010/03/simple-website-layout-tutorial-using-html5-and-css3/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 08:20:19 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://css-image.com/resources/?p=24</guid>
		<description><![CDATA[As most of us know HTML 5 has created a big buzz on internet and is sure to give Adobe a hard time. Apple believes that HTML5 is what will define the web and would love to see more developers adopt it instead of Flash. Now that big video sites such as YouTube are testing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://css-image.com/resources/wp-content/uploads/2010/03/html5-150x1501.jpg"><img class="size-full wp-image-25 alignleft" title="html5" src="http://css-image.com/resources/wp-content/uploads/2010/03/html5-150x1501.jpg" alt="" width="150" height="150" /></a>As most of us know <em><strong>HTML 5</strong></em> has created a big buzz on internet and is sure to give Adobe a hard time. Apple believes that <em>HTML5</em> is what will define the web and would love to see more developers adopt it instead of Flash. Now that big video sites such as YouTube are testing support for HTML5 (Mashable).</p>
<p><strong>HTML 5</strong> is a breakthrough which will improve the sites from design view point, seo etc. It when combined with css3 can make amazing web sites. For this you should check out this collection of all HTML 4 &amp; 5 <a href="http://html5tutorial.net/html-5-reference/html-5-reference.html" target="_blank">Tags reference sheet.</a></p>
<p>The Most prominent additions in HTML 5 are tags like &lt;header&gt;, &lt;footer&gt;, &lt;aside&gt;, &lt;nav&gt;, &lt;audio&gt; etc. HTML 5 will also include APIs for drawing graphics on screen, storing data offline, dragging and dropping, and a lot more . Site layout would be easily understandable and in code, tags are easy to understand as well Like the few tags i listed above clearly explains that :<span id="more-24"></span></p>
<ul>
<li><strong>&lt;header&gt;</strong> = Header (Head area of the site)</li>
<li><strong>&lt;nav&gt;</strong> = Navigation (Menu/Navigation Area)</li>
<li><strong>&lt;footer&gt;</strong> = Footer Area</li>
<li><strong>&lt;aside&gt;</strong> = An area on a side (Side Bar)</li>
</ul>
<h2>Simple HTML 5 Tutorial</h2>
<p>We will make a very very Simple web page with HTML 5 and styling with CSS 3. This is how the final result will look like :</p>
<p><a href="http://www.designzzz.com/wp-content/uploads/2010/02/final.jpg" target="_blank"><img title="final" src="http://www.designzzz.com/wp-content/uploads/2010/02/final-630x478.jpg" alt="Final HTML 5 Tutorial Result" width="630" height="478" /></a></p>
<p><strong>Demo and Source:</strong></p>
<ul>
<li><strong><a href="http://www.designzzz.com/html-5-tutorial.html" target="_blank">View Demo</a></strong></li>
<li><a href="http://www.designzzz.com/html-5.zip" target="_blank"><strong>Download Source</strong></a></li>
</ul>
<h3>Starting HTML Tutorial Code:</h3>
<p>The Structure would be like this :</p>
<div id="highlighter_109067">
<div>
<div><a title="view source" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#viewSource">view source</a></p>
<div><object id="highlighter_109067_clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="highlighterId=highlighter_109067" /><param name="src" value="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" /><param name="wmode" value="transparent" /><embed id="highlighter_109067_clipboard" type="application/x-shockwave-flash" width="16" height="16" src="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" wmode="transparent" flashvars="highlighterId=highlighter_109067"></embed></object></div>
<p><a title="print" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#printSource">print</a><a title="?" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>&lt;!Doctype html&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>&lt;</code><code>html</code> <code>lang</code><code>=</code><code>"en"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>&lt;</code><code>head</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>&lt;</code><code>title</code><code>&gt;Your Page title&lt;/</code><code>title</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>&lt;/</code><code>head</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>&lt;</code><code>body</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>&lt;!-- Define Header --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>&lt;</code><code>header</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>&lt;/</code><code>header</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>&lt;!-- End Header --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>&lt;!-- Define Navigation/Menu --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>&lt;</code><code>nav</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>&lt;/</code><code>nav</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>&lt;!-- End Navigation --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>&lt;!-- Main content area --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>&lt;</code><code>section</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>&lt;/</code><code>section</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>&lt;!-- End of Main content area --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>&lt;!-- Sidebar --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>&lt;</code><code>aside</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>&lt;/</code><code>aside</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>&lt;!-- End Sidebar --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td><code>&lt;!-- Footer --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>24</code></td>
<td><code>&lt;</code><code>footer</code><code>&gt;&lt;/</code><code>footer</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>25</code></td>
<td><code>&lt;!-- End of Footer --&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>26</code></td>
<td><code>&lt;/</code><code>body</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>27</code></td>
<td><code>&lt;/</code><code>html</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><strong>Defining Header Tag:</strong></p>
<div id="highlighter_272095">
<div>
<div><a title="view source" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#viewSource">view source</a></p>
<div><object id="highlighter_272095_clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="highlighterId=highlighter_272095" /><param name="src" value="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" /><param name="wmode" value="transparent" /><embed id="highlighter_272095_clipboard" type="application/x-shockwave-flash" width="16" height="16" src="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" wmode="transparent" flashvars="highlighterId=highlighter_272095"></embed></object></div>
<p><a title="print" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#printSource">print</a><a title="?" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>header</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>&lt;</code><code>h1</code><code>&gt;HTML 5 Tutorial Sample &lt;/</code><code>h1</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>&lt;/</code><code>header</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Doctype and Html Lang Added.<em> Thanks for the suggestion Mark</em> for correcting validation.</p>
<p><strong>Defining Navigation Area with Few links in it:</strong></p>
<div id="highlighter_237278">
<div>
<div><a title="view source" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#viewSource">view source</a></p>
<div><object id="highlighter_237278_clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="highlighterId=highlighter_237278" /><param name="src" value="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" /><param name="wmode" value="transparent" /><embed id="highlighter_237278_clipboard" type="application/x-shockwave-flash" width="16" height="16" src="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" wmode="transparent" flashvars="highlighterId=highlighter_237278"></embed></object></div>
<p><a title="print" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#printSource">print</a><a title="?" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>nav</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>&lt;</code><code>ul</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;Home&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;About Us&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;Feedback&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;Contact&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>&lt;/</code><code>ul</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><strong>Stylizing the Navigation with CSS3 for Rounded Corners:</strong></p>
<div id="highlighter_283453">
<div>
<div><a title="view source" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#viewSource">view source</a></p>
<div><object id="highlighter_283453_clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="highlighterId=highlighter_283453" /><param name="src" value="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" /><param name="wmode" value="transparent" /><embed id="highlighter_283453_clipboard" type="application/x-shockwave-flash" width="16" height="16" src="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" wmode="transparent" flashvars="highlighterId=highlighter_283453"></embed></object></div>
<p><a title="print" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#printSource">print</a><a title="?" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>nav {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>width</code><code>:</code><code>77%</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>height</code><code>:</code><code>40px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>-moz-border-radius:</code><code>10px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>-webkit-border-radius:</code><code>10px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>border-radius:</code><code>10px</code><code>; //for opera</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>background</code><code>:</code><code>#f3f3f3</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>border</code><code>:</code><code>1px</code> <code>solid</code> <code>#cccccc</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>position</code><code>:</code><code>absolute</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>nav ul {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>list-style-image</code><code>:</code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>list-style-position</code><code>:</code><code>outside</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>list-style-type</code><code>:</code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>margin</code><code>:</code><code>0</code> <code>auto</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>width</code><code>:</code><code>940px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>nav ul li {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>float</code><code>:</code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>nav ul li a{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>margin-right</code><code>:</code><code>20px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td><code>display</code><code>:</code><code>block</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>24</code></td>
<td><code>line-height</code><code>:</code><code>40px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>25</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>You can Also use px in Nav width instead of %. In this tutorial’s case you can add width=”960px” .</p>
<p>Then we Defined a DIV for the main content area and in it defined &lt;section&gt; and &lt;article&gt; area where the main content of the page is (the two paragraphs). You can see details in the source with comments for better understanding. The image inserted is also a simple div with css3 in it to show the image in background and rounded corners.</p>
<p>After that comes a very handy and prominent new addition in HTML 5. The &lt;aside&gt; tag which works like a sidebar without any extra css to move it on a side.</p>
<p><strong>Defining Sidebar &lt;aside&gt;:</strong></p>
<div id="highlighter_362842">
<div>
<div><a title="view source" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#viewSource">view source</a></p>
<div><object id="highlighter_362842_clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="highlighterId=highlighter_362842" /><param name="src" value="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" /><param name="wmode" value="transparent" /><embed id="highlighter_362842_clipboard" type="application/x-shockwave-flash" width="16" height="16" src="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" wmode="transparent" flashvars="highlighterId=highlighter_362842"></embed></object></div>
<p><a title="print" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#printSource">print</a><a title="?" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>&lt;</code><code>aside</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>&lt;</code><code>section</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>&lt;</code><code>ul</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;Home&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;About Us&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;Feedback&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>&lt;</code><code>li</code><code>&gt;&lt;</code><code>a</code> <code>href</code><code>=</code><code>"#"</code><code>&gt;Contact&lt;/</code><code>a</code><code>&gt;&lt;/</code><code>li</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>&lt;/</code><code>ul</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>&lt;/</code><code>section</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>&lt;/</code><code>aside</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>The UL (unordered list ) is repeated three times in the code.  Its just for giving an idea how sections will look like and links are dummy as well you can put blogrolls, categories etc. anything you like.</p>
<p><strong>Defining the Footer:</strong></p>
<div id="highlighter_965969">
<div>
<div><a title="view source" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#viewSource">view source</a></p>
<div><object id="highlighter_965969_clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="highlighterId=highlighter_965969" /><param name="src" value="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" /><param name="wmode" value="transparent" /><embed id="highlighter_965969_clipboard" type="application/x-shockwave-flash" width="16" height="16" src="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" wmode="transparent" flashvars="highlighterId=highlighter_965969"></embed></object></div>
<p><a title="print" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#printSource">print</a><a title="?" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;</code><code>footer</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>&lt;</code><code>section</code><code>&gt;Anything you want to put in footer goes here. &lt;/</code><code>section</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>&lt;/</code><code>footer</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><strong>Stylizing the Footer:</strong></p>
<div id="highlighter_45409">
<div>
<div><a title="view source" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#viewSource">view source</a></p>
<div><object id="highlighter_45409_clipboard" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16" height="16" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="highlighterId=highlighter_45409" /><param name="src" value="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" /><param name="wmode" value="transparent" /><embed id="highlighter_45409_clipboard" type="application/x-shockwave-flash" width="16" height="16" src="http://www.designzzz.com/wp-content/plugins/syntax-highlighter-and-code-prettifier/scripts/clipboard.swf" wmode="transparent" flashvars="highlighterId=highlighter_45409"></embed></object></div>
<p><a title="print" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#printSource">print</a><a title="?" href="http://www.designzzz.com/website-layout-tutorial-html-5-css-3/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>footer{</code><code>background</code><code>:</code><code>#666666</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>border-top</code><code>:</code><code>1px</code> <code>solid</code> <code>#cccccc</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>padding</code><code>:</code><code>10px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>-moz-border-radius-topleft:</code><code>5px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>-moz-border-radius-topright:</code><code>5px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>border-radius:</code><code>5px</code><code>; // for Opera</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>text-align</code><code>:</code><code>center</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>color</code><code>:</code><code>#ffffff</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>9</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><strong>What’s Covered so Far:</strong></p>
<ul>
<li>So far we have learned how to make simple HTML 5 Tags Layout</li>
<li>Understanding of the Tags and their behaviors</li>
<li>CSS3 for Rounded Corners and Text Shadows</li>
</ul>
<p><a href="http://www.designzzz.com/html-5.zip" target="_blank">Download Source Here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://css-image.com/resources/2010/03/simple-website-layout-tutorial-using-html5-and-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Power of HTML 5 and CSS 3</title>
		<link>http://css-image.com/resources/2010/03/the-power-of-html-5-and-css-3/</link>
		<comments>http://css-image.com/resources/2010/03/the-power-of-html-5-and-css-3/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 07:15:31 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://css-image.com/resources/?p=10</guid>
		<description><![CDATA[Web designers can do some pretty cool stuff with HTML 4 and CSS 2.1. We can structure our documents logically and create information-rich sites without relying on archaic, table-based layouts. We can style our web pages with beauty and detail without resorting to inline &#60;font&#62; and &#60;br&#62; tags. Indeed, our current design methods have taken [...]]]></description>
			<content:encoded><![CDATA[<p>Web designers can do some pretty cool stuff with <acronym title="Hypertext Markup Language">HTML</acronym> 4 and <acronym title="Cascading Style Sheets">CSS</acronym> 2.1. We can structure our documents logically and create information-rich sites without relying on archaic, table-based layouts. We can style our web pages with beauty and detail without resorting to inline <code>&lt;font&gt;</code> and <code>&lt;br&gt;</code> tags. Indeed, our current design methods have taken us far beyond the hellish era of browser wars, proprietary protocols, and those hideous flashing, scrolling, and blinking web pages.</p>
<p>As far as we’ve come using <acronym title="Hypertext Markup Language">HTML</acronym> 4 and <acronym title="Cascading Style Sheets">CSS</acronym> 2.1, however, we can do better. We can refine the structure of our documents and increase their semantic precision. We can sharpen the presentation of our stylesheets and advance their stylistic flexibility. As we continue to push the boundaries of <em>existing</em> languages, <acronym title="Hypertext Markup Language">HTML</acronym> 5 and <acronym title="Cascading Style Sheets">CSS</acronym> 3 are quickly gaining popularity, revealing their collective power with some exciting new design possibilities.</p>
<p><span id="more-10"></span></p>
<h3>Goodbye <code>&lt;div&gt;</code> soup, hello semantic markup</h3>
<p>In the past, designers wrestled with semantically incorrect table-based layouts. Eventually, thanks to revolutionary thinking from the likes of <a title="Zeldman.com" href="http://www.zeldman.com/">Jeffrey Zeldman</a> and <a title="meyerweb.com" href="http://meyerweb.com/">Eric Meyer</a>, savvy designers embraced more semantically correct layout methods, structuring their pages with <code>&lt;div&gt;</code> elements instead of tables, and using external stylesheets for presentation. Unfortunately, complex designs require significant differentiation of underlying structural elements, which commonly results in the “<code>&lt;div&gt;</code>-soup” syndrome. Perhaps this looks familiar:</p>
<pre><code>&lt;div id="news"&gt;
   &lt;div&gt;
      &lt;div&gt;
         &lt;div&gt;
            &lt;h1&gt;Div Soup Demonstration&lt;/h1&gt;
            &lt;p&gt;Posted on July 11th, 2009&lt;/p&gt;
         &lt;/div&gt;
         &lt;div&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
         &lt;/div&gt;
         &lt;div&gt;
            &lt;p&gt;Tags: HMTL, code, demo&lt;/p&gt;
         &lt;/div&gt;
      &lt;/div&gt;
      &lt;div&gt;
         &lt;div&gt;
            &lt;h1&gt;Tangential Information&lt;/h1&gt;
         &lt;/div&gt;
         &lt;div&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
         &lt;/div&gt;
         &lt;div&gt;
            &lt;p&gt;Tags: HMTL, code, demo&lt;/p&gt;
         &lt;/div&gt;
      &lt;/div&gt;
   &lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>While slightly contrived, this example serves to illustrate the structural redundancy of designing complex layouts with <acronym title="Hypertext Markup Language">HTML</acronym> 4 (as well as <acronym title="eXtensible Hypertext Markup Language">XHTML</acronym> 1.1 et al). Fortunately, <acronym title="Hypertext Markup Language">HTML</acronym> 5 alleviates <code>&lt;div&gt;</code>-soup syndrome by giving us a new set of structural elements. These <a title="Rethinking Structural Design with New Elements in HTML 5" href="http://perishablepress.com/press/2007/08/21/rethinking-structural-design-with-new-elements-in-html-5/">new <acronym title="Hypertext Markup Language">HTML</acronym> 5 elements</a> replace meaningless <code>&lt;div&gt;</code>s with more semantically accurate definitions, and in doing so provide more “natural” <acronym title="Cascading Style Sheets">CSS</acronym> hooks with which to style the document. With <acronym title="Hypertext Markup Language">HTML</acronym> 5, our example evolves:</p>
<pre><code>&lt;section&gt;
   &lt;section&gt;
      &lt;article&gt;
         &lt;header&gt;
            &lt;h1&gt;Div Soup Demonstration&lt;/h1&gt;
            &lt;p&gt;Posted on July 11th, 2009&lt;/p&gt;
         &lt;/header&gt;
         &lt;section&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
         &lt;/section&gt;
         &lt;footer&gt;
            &lt;p&gt;Tags: HMTL, code, demo&lt;/p&gt;
         &lt;/footer&gt;
      &lt;/article&gt;
      &lt;aside&gt;
         &lt;header&gt;
            &lt;h1&gt;Tangential Information&lt;/h1&gt;
         &lt;/header&gt;
         &lt;section&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
            &lt;p&gt;Lorem ipsum text blah blah blah.&lt;/p&gt;
         &lt;/section&gt;
         &lt;footer&gt;
            &lt;p&gt;Tags: HMTL, code, demo&lt;/p&gt;
         &lt;/footer&gt;
      &lt;/aside&gt;
   &lt;/section&gt;
&lt;/section&gt;</code></pre>
<p>As you can see, <acronym title="Hypertext Markup Language">HTML</acronym> 5 enables us to replace our multitude of <code>&lt;div&gt;</code>s with semantically meaningful structural elements. This semantic specificity not only improves the underlying quality and meaningfulness of our web pages, but also enables us to remove many of the <code>class</code> and <code>id</code> attributes that were previously required for targeting our <acronym title="Cascading Style Sheets">CSS</acronym>. In fact, <acronym title="Cascading Style Sheets">CSS</acronym> 3 makes it possible to eliminate virtually all <code>class</code> and <code>id</code> attributes.</p>
<h3>Goodbye <code>class</code> attributes, hello clean markup</h3>
<p>When combined with the new semantic elements of <acronym title="Hypertext Markup Language">HTML</acronym> 5, <acronym title="Cascading Style Sheets">CSS</acronym> 3 provides web designers with god-like powers over their web pages. With the power of <acronym title="Hypertext Markup Language">HTML</acronym> 5, we obtain significantly more control over the <em>structure</em> of our documents, and with the power of <acronym title="Cascading Style Sheets">CSS</acronym> 3, our control over the <em>presentation</em> of our documents tends toward infinity.</p>
<p>Even without some of the advanced <acronym title="Cascading Style Sheets">CSS</acronym> selectors available to us, the new variety of specific <acronym title="Hypertext Markup Language">HTML</acronym> 5 elements enable us to apply styles across similar sections <em>without</em> the need for defining <code>class</code> and <code>id</code> attributes. To style our previous <code>&lt;div&gt;</code>-soup example, we would target the multitude of attributes via the following <acronym title="Cascading Style Sheets">CSS</acronym>:</p>
<pre><code>div#news    {}
div.section {}
div.article {}
div.header  {}
div.content {}
div.footer  {}
div.aside   {}</code></pre>
<p>On the other hand, to style our <acronym title="Hypertext Markup Language">HTML</acronym> 5 example, we may target the various documents regions directly with this <acronym title="Cascading Style Sheets">CSS</acronym>:</p>
<pre><code>section {}
article {}
header  {}
footer  {}
aside   {}</code></pre>
<p>This is an improvement, but there are several issues that need addressed. With the <code>&lt;div&gt;</code> example, we target each area specifically through use of <code>class</code> and <code>id</code> attributes. Using this logic allows us to apply styles to each region of the document, either collectively or individually. For example, in the <code>&lt;div&gt;</code> case, <code>.section</code> and <code>.content</code> divisions are easily distinguished; however, in the <acronym title="Hypertext Markup Language">HTML</acronym> 5 case, the <code>section</code> element is used for both of these areas and others as well. This is easily resolved by adding specific attribute selectors to the different <code>section</code> elements, but thankfully, we instead may use a few advanced <acronym title="Cascading Style Sheets">CSS</acronym> selectors to target the different <code>section</code> elements in obtrusive fashion.</p>
<h3>Targeting HTML-5 elements without classes or ids</h3>
<p>Rounding out the article, let’s look at some practical examples of targeting <acronym title="Hypertext Markup Language">HTML</acronym>-5 elements without <code>class</code>es or <code>id</code>s. There are three types of <acronym title="Cascading Style Sheets">CSS</acronym> selectors that will enable us to target and differentiate the elements in our example. They are as follows:</p>
<ul>
<li>The descendant selector <small>[CSS 2.1]</small>: <strong>E F</strong></li>
<li>The adjacent selector <small>[CSS 2.1]</small>: <strong>E + F</strong></li>
<li>The child selector <small>[CSS 2.1]</small>: <strong>E &gt; F</strong></li>
</ul>
<p>Let’s have a look at how these selectors enable us to target each of our document sections without the need for <code>class</code>es or <code>id</code>s.</p>
<p><strong>Targeting the outermost <code>&lt;section&gt;</code> element</strong><br />
Due to the incompleteness of our example, we will assume that the outermost <code>&lt;section&gt;</code> element is <em>adjacent</em> to a <code>&lt;nav&gt;</code> element which itself is a direct descendant of the <code>&lt;body&gt;</code> element. In this case, we may target the outermost <code>&lt;section&gt;</code> as follows:</p>
<pre><code>body nav+section {}</code></pre>
<p><strong>Targeting the next <code>&lt;section&gt;</code> element</strong><br />
As the only direct descendant of the outer <code>&lt;section&gt;</code>, the next <code>&lt;section&gt;</code> element may be specifically targeted with the following selector:</p>
<pre><code>section&gt;section {}</code></pre>
<p><strong>Targeting the <code>&lt;article&gt;</code> element</strong><br />
There are several ways to target the <code>&lt;article&gt;</code> element specifically, but the easiest is to use a simple descendant selector:</p>
<pre><code>section section article {}</code></pre>
<p><strong>Targeting the <code>header</code>, <code>section</code>, and <code>footer</code> elements</strong><br />
In our example, each of these three elements exists in two locations: once inside the <code>&lt;article&gt;</code> element and once inside the <code>&lt;aside&gt;</code> element. This distinction makes it easy to target each element individually:</p>
<pre><code>article header {}
article section {}
article footer {}</code></pre>
<p>..or collectively:</p>
<pre><code>section section header {}
section section section {}
section section footer {}</code></pre>
<p>So far, we have managed to eliminate all <code>class</code>es and <code>id</code>s using only <acronym title="Cascading Style Sheets">CSS</acronym> 2.1. So why do we even need anything from <acronym title="Cascading Style Sheets">CSS</acronym> 3? I’m glad you asked..</p>
<h3>Advanced targeting of HTML 5 with CSS 3</h3>
<p>While we have managed to target every element in our example using only valid <acronym title="Cascading Style Sheets">CSS</acronym> 2.1, there are obviously more complicated situations where the more advanced selective power of <acronym title="Cascading Style Sheets">CSS</acronym> 3 is required. Let’s wrap things up with a few specific examples showing how <acronym title="Cascading Style Sheets">CSS</acronym> 3 enables us to style any element <em>without</em> extraneous <code>class</code> or <code>id</code> attributes.</p>
<p><strong>Targeting all posts with a unique post ID</strong><br />
WordPress provides us a way of including the ID of each post in the source-code output. This information is generally used for navigational and/or informational purposes, but with <acronym title="Cascading Style Sheets">CSS</acronym> 3 we can use these existing yet unique ID attributes as a way to select the posts for styling. Sure, you could always just add a <code>class="post"</code> attribute to every post, but that would defeat the point of this exercise (plus it’s no fun). By using the “substring matching attribute selector,” we can target all posts and their various elements like this:</p>
<pre><code>article[id*=post-] {}           /* target all posts */
article[id*=post-] header h1 {} /* target all post h1 tags */
article[id*=post-] section p {} /* target all post p tags */</code></pre>
<p>Now that’s just sick, and we can do the same thing for numerically identified comments, enabling us to apply targeted styles to associated constructs:</p>
<pre><code>article[id*=comment-] {}           /* target all comments */
article[id*=comment-] header h1 {} /* target all comment h1 tags */
article[id*=comment-] section p {} /* target all comment p tags */</code></pre>
<p><strong>Target any specific section or article</strong><br />
Many sites display numerous of posts and comments. With <acronym title="Hypertext Markup Language">HTML</acronym> 5, the markup for these items consists of repetitive series of <code>&lt;section&gt;</code> or <code>&lt;article&gt;</code> elements. To target <em>specific</em> <code>&lt;section&gt;</code> or <code>&lt;article&gt;</code> elements, we turn to the incredible power of the “<code>:nth-child</code>” selector:</p>
<pre><code>section:nth-child(1) {} /* select the first &lt;section&gt; */
article:nth-child(1) {} /* select the first &lt;article&gt; */

section:nth-child(2) {} /* select the second &lt;section&gt; */
article:nth-child(2) {} /* select the second &lt;article&gt; */</code></pre>
<p>In a similar manner, we may also target specific elements in <em>reverse</em> order via the “<code>:nth-last-child</code>” selector:</p>
<pre><code>section:nth-last-child(1) {} /* select the last &lt;section&gt; */
article:nth-last-child(1) {} /* select the last &lt;article&gt; */

section:nth-last-child(2) {} /* select the penultimate &lt;section&gt; */
article:nth-last-child(2) {} /* select the penultimate &lt;article&gt; */</code></pre>
<p><strong>More ways to select specific elements</strong><br />
Another way to select specific instances of <acronym title="Hypertext Markup Language">HTML</acronym>-5 elements such as <code>&lt;header&gt;</code>, <code>&lt;section&gt;</code>, and <code>&lt;footer&gt;</code>, is to take advantage of the “<code> <img src='http://css-image.com/resources/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly-of-type</code>” selector. With these <acronym title="Hypertext Markup Language">HTML</acronym>-5 elements appearing in multiple locations in the web document, it may be useful to target elements that appear only once within a particular parent element. For example, to select only <code>&lt;section&gt;</code> elements that are the only <code>&lt;section&gt;</code> elements within another <code>&lt;section&gt;</code> element (insane, I know), as in the following markup:</p>
<pre><code>&lt;section&gt;
   &lt;section&gt;&lt;/section&gt;
   &lt;section&gt;
      &lt;section&gt;Target this section&lt;/section&gt;
   &lt;/section&gt;
   &lt;section&gt;
      &lt;section&gt;Target this section&lt;/section&gt;
   &lt;/section&gt;
   &lt;section&gt;
      &lt;section&gt;But not this section&lt;/section&gt;
      &lt;section&gt;And not this section&lt;/section&gt;
   &lt;/section&gt;
   &lt;section&gt;&lt;/section&gt;
&lt;/section&gt;</code></pre>
<p>..we could simply use the following selector:</p>
<pre><code>section&gt;section:only-of-type {}</code></pre>
<p>Again, you could always add an <code>id</code> to the target element, but you would lose the increased scalability, maintainablity, and clarity made possible with an absolute separation of structure and presentation.</p>
<p>The take-home message for these examples is that <acronym title="Cascading Style Sheets">CSS</acronym> 3 makes it possible to target virtually any <acronym title="Hypertext Markup Language">HTML</acronym>-5 element <em>without</em> littering the document with superfluous presentational attributes.</p>
]]></content:encoded>
			<wfw:commentRss>http://css-image.com/resources/2010/03/the-power-of-html-5-and-css-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 Ways to Preload Images with CSS, JavaScript, or Ajax</title>
		<link>http://css-image.com/resources/2010/03/3-ways-to-preload-images-with-css-javascript-or-ajax/</link>
		<comments>http://css-image.com/resources/2010/03/3-ways-to-preload-images-with-css-javascript-or-ajax/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 07:14:07 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[CSS Image Gallery]]></category>
		<category><![CDATA[CSS Menu]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://css-image.com/resources/?p=8</guid>
		<description><![CDATA[reloading images is a great way to improve the user experience. When images are preloaded in the browser, the visitor can surf around your site and enjoy extremely faster loading times. This is especially beneficial for photo galleries and other image-heavy sites where you want to deliver the goods as quickly and seamlessly as possible. [...]]]></description>
			<content:encoded><![CDATA[<p>reloading images is a great way to improve the user experience. When images are preloaded in the browser, the visitor can surf around your site and enjoy extremely faster loading times. This is especially beneficial for photo galleries and other image-heavy sites where you want to deliver the goods as quickly and seamlessly as possible. Preloading images definitely helps users without broadband enjoy a better experience when viewing your content. In this article, we’ll explore three different preloading techniques to enhance the performance and usability of your site.</p>
<h3>Method 1: Preloading with CSS and JavaScript</h3>
<p>There are many ways to preload images, including methods that rely on <acronym title="Cascading Style Sheets">CSS</acronym>, JavaScript, and various combinations thereof. As one of my favorite topics here at <a title="Perishable Press: Digital Design and Dialogue" href="http://perishablepress.com/">Perishable Press</a>, I have covered image preloading numerous times:</p>
<p>Each of these techniques sort of builds on previous methods and remains quite effective and suitable for a variety of design scenarios. Thankfully, readers always seem to chime in on these posts with suggestions and improvements. Recently, Ian Dunn posted an article that improves upon my Better Image Preloading without JavaScript method.</p>
<p>With that method, images are easily and effectively preloaded using the following <acronym title="Cascading Style Sheets">CSS</acronym>:<span id="more-8"></span></p>
<pre><code>#preload-01 { background: url(http://domain.tld/image-01.png) no-repeat -9999px -9999px; }
#preload-02 { background: url(http://domain.tld/image-02.png) no-repeat -9999px -9999px; }
#preload-03 { background: url(http://domain.tld/image-03.png) no-repeat -9999px -9999px; }</code></pre>
<p>By strategically applying <code>preload</code> IDs to <em>existing</em> <acronym title="(eXtensible) Hypertext Markup Language">(X)HTML</acronym> elements, we can use <acronym title="Cascading Style Sheets">CSS</acronym>’ <code>background</code> property to preload select images off-screen in the background. Then, as long as the paths to these images remains the same when they are referred to elsewhere in the web page, the browser will use the preloaded/cached images when rendering the page. Simple, effective, and <em>no</em> JavaScript required.</p>
<p>As effective as this method is, however, there is room for improvement. As Ian points out, images that are preloaded using this method will be loaded along with the other page contents, thereby increasing overall loading time for the page. To resolve this issue, we can use a little bit of JavaScript to delay the preloading until <em>after</em> the page has finished loading. This is easily accomplished by applying the <acronym title="Cascading Style Sheets">CSS</acronym> <code>background</code> properties using <a title="Executing JavaScript on page load" href="http://simonwillison.net/2004/May/26/addLoadEvent/">Simon Willison’s addLoadEvent()</a> script:</p>
<pre><code>// better image preloading @ http://perishablepress.com/press/2009/12/28/3-ways-preload-images-css-javascript-ajax/
function preloader() {
	if (document.getElementById) {
		document.getElementById("preload-01").style.background = "url(http://domain.tld/image-01.png) no-repeat -9999px -9999px";
		document.getElementById("preload-02").style.background = "url(http://domain.tld/image-02.png) no-repeat -9999px -9999px";
		document.getElementById("preload-03").style.background = "url(http://domain.tld/image-03.png) no-repeat -9999px -9999px";
	}
}
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}
addLoadEvent(preloader);</code></pre>
<p>In the first part of this script, we are setting up the actual preloading by targeting specific <code>preload</code> elements with <code>background</code> styles that call the various images. Thus, to use this method, you will need to replace the “<code>preload-01</code>”, “<code>preload-02</code>”, “<code>preload-03</code>”, etc., with the IDs that you will be targeting in your markup. Also, for each of the <code>background</code> properties, you will need to replace the “<code>image-01.png</code>”, “<code>image-02.png</code>”, “<code>image-03.png</code>”, etc., with the path and name of your image files. No other editing is required for this technique to work.</p>
<p>Then, in the second part of the script, we are using the <code>addLoadEvent()</code> function to delay execution of our <code>preloader()</code> function until after the page has loaded.</p>
<p>SO what happens when JavaScript is not available on the user’s browser? Quite simply, the images will not be preloaded and will load as normal when called in the web page. This is exactly the sort of unobtrusive, gracefully degrading JavaScript that we really like :)</p>
<h3>Method 2: Preloading with JavaScript Only</h3>
<p>As effective as the previous method happens to be, I generally find it to be too tedious and time-consuming to actually implement. Instead, I generally prefer to preload images using a straight-up slice of JavaScript. Here are a couple of JavaScript-only preloading methods that work beautifully in virtually every modern browser..</p>
<h4>JavaScript Method #1</h4>
<p>Unobtrusive, gracefully degrading, and easy to implement, simply edit/add the image paths/names as needed — no other editing required:</p>
<pre><code>&lt;div&gt;
	&lt;script type="text/javascript"&gt;
		&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!--
			var images = new Array()
			function preload() {
				for (i = 0; i &lt; preload.arguments.length; i++) {
					images[i] = new Image()
					images[i].src = preload.arguments[i]
				}
			}
			preload(
				"http://domain.tld/gallery/image-001.jpg",
				"http://domain.tld/gallery/image-002.jpg",
				"http://domain.tld/gallery/image-003.jpg"
			)
		//--&gt;&lt;!]]&gt;
	&lt;/script&gt;
&lt;/div&gt;</code></pre>
<p>This method is especially convenient for preloading large numbers of images. On one of my gallery sites, I use this technique to preload almost 50 images. By including this script on the login page as well as internal money pages, most of the gallery images are preloaded by the time the user enters their login credentials. Nice.</p>
<h4>JavaScript Method #2</h4>
<p>Here’s another similar method that uses unobtrusive JavaScript to preload any number of images. Simply include the following script into any of your web pages and edit according to the proceeding instructions:</p>
<pre><code>&lt;div&gt;
	&lt;script type="text/javascript"&gt;
		&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!--

			if (document.images) {
				img1 = new Image();
				img2 = new Image();
				img3 = new Image();

				img1.src = "http://domain.tld/path/to/image-001.gif";
				img2.src = "http://domain.tld/path/to/image-002.gif";
				img3.src = "http://domain.tld/path/to/image-003.gif";
			}

		//--&gt;&lt;!]]&gt;
	&lt;/script&gt;
&lt;/div&gt;</code></pre>
<p>As you can see, each preloaded image requires a variable definition, “<code>img1</code> <code>=</code> <code>new</code> <code>Image();</code>”, as well as a source declaration, “<code>img3.src</code> <code>=</code> <code>"../path/to/image-003.gif";</code>”. By replicating the pattern, you can preload as many images as necessary. Hopefully this is clear — if not, please leave a comment and someone will try to help you out.</p>
<p>We can even improve this method a bit by delaying preloading until <em>after</em> the page loads. To do this, we simply wrap the script in a function and use <code>addLoadEvent()</code> to make it work:</p>
<pre><code>function preloader() {
	if (document.images) {
		var img1 = new Image();
		var img2 = new Image();
		var img3 = new Image();

		img1.src = "http://domain.tld/path/to/image-001.gif";
		img2.src = "http://domain.tld/path/to/image-002.gif";
		img3.src = "http://domain.tld/path/to/image-003.gif";
	}
}
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}
addLoadEvent(preloader);</code></pre>
<p>Ahhh, the joys of <a title="'JavaScript' Archive at Perishable Press" href="http://perishablepress.com/press/tag/javascript/">JavaScript</a>!</p>
<h3>Method 3: Preloading with Ajax</h3>
<p>As if all of that weren’t cool enough, here is a way to preload images using <acronym title="Asynchronous JavaScript XML">Ajax</acronym>. This method was discovered at <a title="2 ways to cache JavaScript, CSS and image only" href="http://desgeeksetdeslettres.com/blog/en/programmation-java/2-facons-de-mettre-en-cache-le-javascript-css-et-image-simplement/comment-page-1/">Of Geeks and letters</a>, and uses the <acronym title="Document Object Model">DOM</acronym> to preload not only images, but <acronym title="Cascading Style Sheets">CSS</acronym>, JavaScript, and just about anything else. The main benefit of using <acronym title="Asynchronous JavaScript XML">Ajax</acronym> over straight JavaScript is that JavaScript and <acronym title="Cascading Style Sheets">CSS</acronym> files can be preloaded without their contents affecting the current page. For images this is not really an issue, but the method is clean and effective nonetheless.</p>
<pre><code>window.onload = function() {
	setTimeout(function() {
		// XHR to request a JS and a CSS
		var xhr = new XMLHttpRequest();
		xhr.open('GET', 'http://domain.tld/preload.js');
		xhr.send('');
		xhr = new XMLHttpRequest();
		xhr.open('GET', 'http://domain.tld/preload.css');
		xhr.send('');
		// preload image
		new Image().src = "http://domain.tld/preload.png";
	}, 1000);
};</code></pre>
<p>As is, this code will preload three files: “<code>preload.js</code>”, “<code>preload.css</code>”, and “<code>preload.png</code>”. A timeout of <code>1000ms</code> is also set to prevent the script from hanging and causing issues with normal page functionality.</p>
<p>To wrap things up, let’s look at how this preloading session would look written in plain JavaScript:</p>
<pre><code>window.onload = function() {

	setTimeout(function() {

		// reference to &lt;head&gt;
		var head = document.getElementsByTagName('head')[0];

		// a new CSS
		var css = document.createElement('link');
		css.type = "text/css";
		css.rel  = "stylesheet";
		css.href = "http://domain.tld/preload.css";

		// a new JS
		var js  = document.createElement("script");
		js.type = "text/javascript";
		js.src  = "http://domain.tld/preload.js";

		// preload JS and CSS
		head.appendChild(css);
		head.appendChild(js);

		// preload image
		new Image().src = "http://domain.tld/preload.png";

	}, 1000);

};</code></pre>
<p>Here we are preloading our three files upon page load by creating three elements via the <acronym title="Document Object Model">DOM</acronym>. As mentioned in the original article, this method is inferior to the <acronym title="Asynchronous JavaScript XML">Ajax</acronym> method in cases where the preloaded file contents should not be applied to the loading page.</p>
]]></content:encoded>
			<wfw:commentRss>http://css-image.com/resources/2010/03/3-ways-to-preload-images-with-css-javascript-or-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better CSS Image Caching</title>
		<link>http://css-image.com/resources/2010/03/better-css-image-caching/</link>
		<comments>http://css-image.com/resources/2010/03/better-css-image-caching/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 07:08:17 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://css-image.com/resources/?p=3</guid>
		<description><![CDATA[
Previous image-preloading techniques target all browsers, devices, and media types. Unfortunately, certain browsers do not load images that are hidden directly (via the &#60;img&#62; element) or indirectly (e.g., via the parent &#60;div&#62; element) using either display:none; or visibility:hidden;. Further problematic is the potential unintentional display of images on pages when presented via specifically designed print [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://css-image.com/resources/wp-content/uploads/2010/03/main1.gif"><img class="size-full wp-image-6 alignleft" title="main[1]" src="http://css-image.com/resources/wp-content/uploads/2010/03/main1.gif" alt="" width="322" height="282" /></a></p>
<p>Previous image-preloading techniques target all browsers, devices, and media types. Unfortunately, certain browsers do not load images that are hidden directly (via the <code>&lt;img&gt;</code> element) or indirectly (e.g., via the parent <code>&lt;div&gt;</code> element) using either <code>display:none;</code> or <code>visibility:hidden;</code>. Further problematic is the potential unintentional display of images on pages when presented via specifically designed <code>print</code> stylesheet.</p>
<p>To get around these limitations, we begin by segregating our strategy to target different <code>media</code> types. For example, for web pages featuring both <code>screen</code> and <code>print</code> stylesheets, we treat each separately by writing this:<span id="more-3"></span></p>
<pre><code>@media screen {}
@media print {}</code></pre>
<p>Then, to ensure that the images are preloaded in all browsers, we need to avoid the use of either <code>display:none;</code> or <code>visibility:hidden;</code> in the method. Rather than risking non-caching by hiding or preventing the display of images that need preloaded, we ensure their display and position them far outside of the screen. To do this, we enclose all images that need cached within some specifically identified <code>div</code>ision like so:</p>
<pre><code>&lt;div id="preloader"&gt;
	&lt;img src="http://domain.tld/path/images/01.png" width="1" height="1" /&gt;
	&lt;img src="http://domain.tld/path/images/02.png" width="1" height="1" /&gt;
	&lt;img src="http://domain.tld/path/images/03.png" width="1" height="1" /&gt;
	&lt;img src="http://domain.tld/path/images/04.png" width="1" height="1" /&gt;
	&lt;img src="http://domain.tld/path/images/05.png" width="1" height="1" /&gt;
	&lt;img src="http://domain.tld/path/images/06.png" width="1" height="1" /&gt;
	&lt;img src="http://domain.tld/path/images/07.png" width="1" height="1" /&gt;
&lt;/div&gt;</code></pre>
<p>Then, with that markup in place, we flesh out the previous <code>media</code> directives with the following <acronym title="Cascading Style Sheet">CSS</acronym>:</p>
<pre><code>@media screen {
	div#preloader {
		position: absolute;
		left: -9999px;
		top:  -9999px;
		}
	div#preloader img {
		display: block;
		}
	}
@media print {
	div#preloader,
	div#preloader img {
		visibility: hidden;
		display: none;
		}
	}</code></pre>
<p>Here, we have the <code>preloader</code> division positioned far to the lower-left outside of the screen, and then redundantly specify <code>block</code> display on the image elements.</p>
<p>Finally, to prevent the unwanted display of these preloaded images via <code>print</code> media, we simply hide the images via <code>display:none;</code> and <code>visibility:hidden;</code> declarations.</p>
<p>When using this method to preload/cache images, remember to call the preloaded images by using the exact same path used for the original preloaded image. For caching to work, the browser must reference an existing resource via the identical path.</p>
<p>This method is designed to enable the caching of specified images in virtually all visual browsing devices. If you encounter cases where this method does not work, or if you have comments or suggestions for improvement, please share by leaving a comment below. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://css-image.com/resources/2010/03/better-css-image-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vertical Sliding Panel with jQuery and CSS3</title>
		<link>http://css-image.com/resources/2009/03/vertical-sliding-panel-with-jquery-and-css3/</link>
		<comments>http://css-image.com/resources/2009/03/vertical-sliding-panel-with-jquery-and-css3/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 07:35:55 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://css-image.com/resources/?p=16</guid>
		<description><![CDATA[Jon Phillips over at Spyre Studios shows us how to create a a sexy vertical sliding panel using jQuery And CSS3. Rather than the usual “top-down” slider, Jon walks through a technique that behaves more like a vertical drawer that doesn’t push down the content on the page. The result is a clean, dynamic-looking “slide-bar” [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://css-image.com/resources/wp-content/uploads/2010/03/slider.jpg"><img class="size-full wp-image-18 alignleft" title="CSS Image Slider" src="http://css-image.com/resources/wp-content/uploads/2010/03/slider.jpg" alt="Vertical  CSS Image Slider" width="365" height="418" /></a>Jon Phillips over at Spyre Studios shows us how to create a a sexy vertical sliding panel using jQuery And CSS3. Rather than the usual “top-down” slider, Jon walks through a technique that behaves more like a vertical drawer that doesn’t push down the content on the page. The result is a clean, dynamic-looking “slide-bar” that rolls open gracefully from the side of the screen.</p>
<p>The tutorial is straightforward and provides everything needed to implement your own vertical sliding panel in very little time. Three steps to completion:</p>
<ol>
<li>The Markup</li>
<li>The CSS</li>
<li>The jQuery<span id="more-16"></span></li>
</ol>
<p>Looks and works great on CSS3-capable browsers. Three different demos also available within the tutorial page.</p>
<p><a href="http://spyrestudios.com/demos/sliding-panel-left/"><img class="alignnone size-full wp-image-15" title="View Demo" src="http://css-image.com/resources/wp-content/uploads/2010/03/demo1.jpg" alt="View CSS Image Demo" width="50" height="25" /></a><a href="http://spyrestudios.com/how-to-create-a-sexy-vertical-sliding-panel-using-jquery-and-css3/"> <img class="alignnone size-full wp-image-17" title="Veiw CSS Slider Document" src="http://css-image.com/resources/wp-content/uploads/2010/03/docs1.jpg" alt="CSS Image Slider" width="117" height="25" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://css-image.com/resources/2009/03/vertical-sliding-panel-with-jquery-and-css3/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/

Minified using disk
Page Caching using disk (user agent is rejected)

Served from: css-image.com @ 2010-09-07 22:10:07 -->