<?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>Inspect Element &#187; html5</title>
	<atom:link href="http://inspectelement.com/tag/html5/feed/" rel="self" type="application/rss+xml" />
	<link>http://inspectelement.com</link>
	<description>Web Design &#38; Development Blog</description>
	<lastBuildDate>Wed, 25 Jan 2012 09:55:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>HTML5 and the Kitchen Sink</title>
		<link>http://inspectelement.com/snippets/html5-and-the-kitchen-sink/</link>
		<comments>http://inspectelement.com/snippets/html5-and-the-kitchen-sink/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 12:42:14 +0000</pubDate>
		<dc:creator>Tom Kenny</dc:creator>
				<category><![CDATA[Snippet]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://inspectelement.com/?p=6999</guid>
		<description><![CDATA[Think there&#8217;s too much? The HTML5 Boilerplate is delete-key friendly. A great starting point for building with HTML5 elements and building a site in general and as stated, you can delete everything you don&#8217;t need and use that as a custom starting point for future projects.]]></description>
			<content:encoded><![CDATA[<blockquote><p>Think there&#8217;s too much? The HTML5 Boilerplate is delete-key friendly.</p></blockquote>
<p>A great starting point for building with HTML5 elements and building a site in general and as stated, you can delete everything you don&#8217;t need and use that as a custom starting point for future projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://inspectelement.com/snippets/html5-and-the-kitchen-sink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 video player comparison</title>
		<link>http://inspectelement.com/snippets/html5-video-player-comparison/</link>
		<comments>http://inspectelement.com/snippets/html5-video-player-comparison/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 11:12:52 +0000</pubDate>
		<dc:creator>Tom Kenny</dc:creator>
				<category><![CDATA[Snippet]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://inspectelement.com/?p=7149</guid>
		<description><![CDATA[It&#8217;s good to see a comparison of HTML5 video players. Early days but looking promising for the future.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s good to see a comparison of HTML5 video players. Early days but looking promising for the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://inspectelement.com/snippets/html5-video-player-comparison/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simulate Realism with CSS3</title>
		<link>http://inspectelement.com/tutorials/simulate-realism-with-css3/</link>
		<comments>http://inspectelement.com/tutorials/simulate-realism-with-css3/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 15:15:09 +0000</pubDate>
		<dc:creator>Tom Kenny</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://inspectelement.com/?p=6577</guid>
		<description><![CDATA[CSS3 is here to make our lives easier as web designers and developers. While it's not something we can always rely on heavily for layout purposes just yet, we can use it to enhance certain aspects of our designs by spending a considerably less amount of time doing so.

However, CSS3 has not been created for the sole purpose of making it easier and quicker to create a website but also so we can create much better sites than we ever could with CSS before. Here are a few examples of how CSS3]]></description>
			<content:encoded><![CDATA[<p>CSS3 is here to make our lives easier as web designers and developers. While it&#8217;s not something we can always rely on heavily for layout purposes just yet, we can use it to <em>enhance</em> certain aspects of our designs by spending a considerably less amount of time doing so.</p>
<p><img class="alignnone size-full wp-image-6599" title="css3realism" src="http://inspectelement.com/wp-content/uploads/2010/02/css3realism.jpg" alt="" width="555" height="216" /></p>
<p>However, CSS3 has not been created for the sole purpose of making it easier and quicker to create a website but also so we can create much better sites than we ever could with CSS before. Here are a few examples of how CSS3 can improve the web.<span id="more-6577"></span><strong> </strong></p>
<h3>Polaroids – <a href="http://inspectelement.com/demos/css3/realism/polaroids.html">View Demo</a></h3>
<p><a href="http://inspectelement.com/demos/css3/realism/polaroids.html"><img class="alignnone size-full wp-image-6593" title="polaroid" src="http://inspectelement.com/wp-content/uploads/2010/02/polaroid.jpg" alt="" width="555" height="305" /></a></p>
<p>Despite not being around today, polaroid images are still iconic and because of this is still a great way to display photos. It&#8217;s simple enough to display a basic polaroid image using a white border on all sides with a thicker border for the bottom but we can enhance it with CSS3. As you&#8217;ll see in the <a href="http://inspectelement.com/demos/css3/realism/polaroids.html">demo</a>, viewed in the latest versions of Safari, Firefox or Chrome, you can add an extra layer of depth with the addition of <strong>drop-shadow</strong> and <strong>transitions</strong>.</p>
<pre><code>img {
	border: 15px solid #fff;
	border-bottom: 65px solid #fff;
	-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
	-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
	-webkit-transform: rotate(1deg);
	-moz-transform: rotate(1deg);
}

img:hover {
	-webkit-box-shadow: 6px 6px 8px rgba(0, 0, 0, 0.1);
	-moz-box-shadow: 6px 6px 8px rgba(0, 0, 0, 0.1);
	-webkit-transform: rotate(1deg) scale(1.05);
	-moz-transform: rotate(1deg) scale(1.05);
}</code></pre>
<p>A subtle shadow gives the impression that is sitting on a flat surface and by scaling and increasing the size and positioning of the shadow on a hover state we can create the illusion that it has been raised slightly from the surface.</p>
<h3>Buttons – <a href="http://inspectelement.com/demos/css3/realism/buttons.html">View Demo</a></h3>
<p><a href="http://inspectelement.com/demos/css3/realism/buttons.html"><img class="alignnone size-full wp-image-6602" title="buttons" src="http://inspectelement.com/wp-content/uploads/2010/02/buttons.jpg" alt="" width="555" height="187" /></a></p>
<p>Why do buttons exist in web design? The web is an interactive medium and buttons are a form of interaction, they are easy to understand as a metaphor for real, physical buttons we use everyday on things like computers, mp3 players, televisions and any other electronic devices we use on a daily basis.</p>
<p>The key to making the buttons behave more like real physical buttons using CSS3 is using code such as shown below for the second button. To achieve a circle with CSS3, set a width and a height and define <strong>border-radius</strong> as half of those values.</p>
<pre><code>button.two {
	width: 30px;
	height: 30px;
	-webkit-border-radius: 15px;
	-moz-border-radius: 15px;
	border-radius: 15px;
	text-indent: -9999px;
	border: 1px solid #696969;
	background: #696969 url(power.png) no-repeat 6px 5px;
}</code></pre>
<p><code> </code></p>
<p>The active state uses CSS3&#8242;s gradient ability to create a gradient that goes from dark at the top to a lighter colour at the bottom. To further emphasise the depression of a button, a CSS transform is applied, scaling down the button slightly. To maintain the background image of the power button, include it in the background property and separate the gradient values with a comma.</p>
<pre><code>button.two:active {
	-webkit-transform: scale(0.97);
	-moz-transform: scale(0.97);
	background: url(power.png) no-repeat 6px 5px, -webkit-gradient(
		linear,
		left bottom,
		left top,
		color-stop(0.13, #696969),
		color-stop(0.72, #2a2a2a)
	);
	background: url(power.png) no-repeat 6px 5px, -moz-linear-gradient(
		center bottom,
		#696969 13%,
		#2a2a2a 62%
	);
}</code></pre>
<p><code> </code></p>
<p>The recessed border also uses CSS3 gradient to get the full effect. The border class is applied to a div containing the button.</p>
<pre><code>.border {
	margin: 0 auto;
	height: 42px;
	width: 42px;
	display: block;
	background-color: #fcfcfc;
	-webkit-border-radius: 21px;
	-moz-border-radius: 21px;
	border-radius: 21px;
	background: -webkit-gradient(
	    linear,
	    left bottom,
	    left top,
	    color-stop(0.13, #fcfcfc),
	    color-stop(0.72, #c0c0c0)
	);
	background: -moz-linear-gradient(
	    center bottom,
	    #fcfcfc 13%,
	    #c0c0c0 62%
	);
	-webkit-box-shadow: 0px 1px 1px rgba(255, 255, 255, 0.6);
}</code></pre>
<p><a href="http://inspectelement.com/demos/css3/realism/buttons.html">View the demo</a> in the latest versions of Safari, Chrome or Firefox.</p>
<h3>DVD Animation – <a href="http://inspectelement.com/demos/css3/realism/dvd.html">View Demo</a></h3>
<p><a href="http://inspectelement.com/demos/css3/realism/dvd.html"><img class="alignnone size-full wp-image-6615" title="dvdanim" src="http://inspectelement.com/wp-content/uploads/2010/02/dvdanim.jpg" alt="" width="555" height="266" /></a></p>
<p>CSS3 has an <a href="http://www.w3.org/TR/css3-animations/">animation module</a> which is plenty of fun to play with especially as you&#8217;ll be able to do things with CSS that you weren&#8217;t able to do before.</p>
<pre><code>a:hover img[alt*="Disc"] {
	-moz-transform: translate(50px,0) rotate(330deg);
	-webkit-transform: translate(50px,0) rotate(330deg);
	transform: translate(50px,0) rotate(330deg);
}</code></pre>
<p>Here the animation is being used to animate the DVDs as as you hover over the link that encapsulates bot the cover and the disc.</p>
<pre><code>img[alt*="Disc"] {
	-moz-transition: all .5s ease-in-out;
	-webkit-transition: all .5s ease-in-out;
	transition: all .5s ease-in-out;
}
</code></pre>
<p>Anyone who follows the work of <a href="http://twitter.com/mALarKeY">Andy Clarke</a> will likely have seen the DVD animation of the homepage of <a href="http://forabeautifulweb.com/">For a Beautiful Web</a>. The above code demonstrates how Andy implemented this effect. At this point I want to highlight what you can do when you see something interesting on the web. All you have to do is have a look at the source code to see exactly how it works and learn from it to see how you could use it in the future. Now I&#8217;m not saying copy someone&#8217;s work but adjust it to your or your client&#8217;s needs.</p>
<p>Zurb also have an <a href="http://www.zurb.com/playground/sliding-vinyl">excellent demonstration</a> of a similar effect which the wrote for <a href="http://www.smashingmagazine.com/2010/01/25/the-new-hotness-using-css3-visual-effects/">Smashing Magazine</a>.</p>
<h3>BONUS: 3D Book Animation – <a href="http://inspectelement.com/demos/css3/realism/book.html">View Demo</a></h3>
<p><a href="http://inspectelement.com/demos/css3/realism/book.html"><img class="alignnone size-full wp-image-6614" title="bookanim" src="http://inspectelement.com/wp-content/uploads/2010/02/bookanim.jpg" alt="" width="555" height="431" /></a></p>
<p>This one is for WebKit based browsers only so fire up the latest version of Safari or Chrome to see it <a href="http://inspectelement.com/demos/css3/realism/book.html">in action</a> and is based on <a href="http://webkit.org/blog-files/3d-transforms/image-flip.html">this example</a> found on the <a href="http://webkit.org/blog/">Surfin&#8217; Safari blog</a>. I&#8217;ll let you hunt around for code to see how it works as discovery is half the fun of learning about CSS. If you have any questions let me know in the comments and either myself or one of our great readers will help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://inspectelement.com/tutorials/simulate-realism-with-css3/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Code a Backwards Compatible, One Page Portfolio with HTML5 and CSS3</title>
		<link>http://inspectelement.com/tutorials/code-a-backwards-compatible-one-page-portfolio-with-html5-and-css3/</link>
		<comments>http://inspectelement.com/tutorials/code-a-backwards-compatible-one-page-portfolio-with-html5-and-css3/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 21:12:14 +0000</pubDate>
		<dc:creator>Tom Kenny</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://inspectelement.com/?p=6298</guid>
		<description><![CDATA[HTML5 is the future of web development but believe it or not you can start using it today. HTML5 is much more considerate to semantics and accessibility as we don't have to throw meaningless div's everywhere. It introduces meaningful tags for common elements such as navigations and footers which makes much more sense and are more natural.

This is a run through of the basics of HTML5 and CSS3 while still paying attention to older browsers. ]]></description>
			<content:encoded><![CDATA[<p>HTML5 is the future of web development but believe it or not you can start using it today. HTML5 is much more considerate to semantics and accessibility as we don&#8217;t have to throw meaningless div&#8217;s everywhere. It introduces meaningful tags for common elements such as navigations and footers which makes much more sense and are more natural.</p>
<p>This is a run through of the basics of HTML5 and CSS3 while still paying attention to older browsers. Before we start, make note of the answer to this question. <a href="http://dowebsitesneedtolookexactlythesameineverybrowser.com/">Do websites need to look exactly the same in every browser?</a></p>
<p style="font-size: 24px;"><a style="font-size: 24px;" href="http://inspectelement.com/html5portfolio/">View Demo</a> | <a style="font-size: 24px;" href="http://inspectelement.com/html5portfolio/HTML5_portfolio.zip">Download Files (.zip)</a></p>
<p><img title="html5portfolio" src="http://inspectelement.com/wp-content/uploads/2010/01/html5portfolio.jpg" alt="" width="555" height="216" /></p>
<p><span id="more-6298"></span><strong></strong></p>
<h3><strong>The HTML</strong></h3>
<pre><code><span>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;

&lt;!-- This is a demonstration of HTML5 goodness with healthy does of CSS3 mixed in --&gt;
&lt;head&gt;

    &lt;title&gt;One Page Portfolio&lt;/title&gt;
    &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8" /&gt;

    &lt;!--[if IE]&gt;
    	&lt;script src="<a class="linkifyplus" href="http://html5shiv.googlecode.com/svn/trunk/html5.js">http://html5shiv.googlecode.com/svn/trunk/html5.js</a>"&gt;&lt;/script&gt;
    &lt;![endif]--&gt;

    &lt;!--[if IE 7]&gt;
    	&lt;link rel="stylesheet" href="ie7.css" type="text/css" media="screen" /&gt;
    &lt;![endif]--&gt;

    &lt;link rel="stylesheet" href="style.css" type="text/css" media="screen" /&gt;

    &lt;script src="<a class="linkifyplus" href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js">http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js</a>" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="js/jquery.anchor.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="js/jquery.fancybox-1.2.6.pack.js" type="text/javascript"&gt;&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

    &lt;header&gt; &lt;!-- HTML5 header tag --&gt;

    	&lt;div id="headercontainer"&gt;

    		&lt;h1&gt;&lt;a class="introlink anchorLink" href="#intro"&gt;Web Design Portfolio&lt;/a&gt;&lt;/h1&gt;

    		&lt;nav&gt; &lt;!-- HTML5 navigation tag --&gt;
    			&lt;ul&gt;
    				&lt;li&gt;&lt;a class="introlink anchorLink" href="#intro"&gt;Intro&lt;/a&gt;&lt;/li&gt;
    				&lt;li&gt;&lt;a class="portfoliolink anchorLink" href="#portfolio"&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
    				&lt;li&gt;&lt;a class="aboutlink anchorLink" href="#about"&gt;About&lt;/a&gt;&lt;/li&gt;
    				&lt;li&gt;&lt;a class="contactlink anchorLink" href="#contact"&gt;Contact&lt;/a&gt;&lt;/li&gt;
    			&lt;/ul&gt;
    		&lt;/nav&gt;

    	&lt;/div&gt;

    &lt;/header&gt;

    &lt;section id="contentcontainer"&gt; &lt;!-- HTML5 section tag for the content 'section' --&gt;

    	&lt;section id="intro"&gt;

    		&lt;h2 class="intro"&gt;Hand-coded &lt;strong&gt;HTML&lt;/strong&gt; and &lt;strong&gt;CSS&lt;/strong&gt; is what I do. &lt;span class="sub"&gt;It's what I'm good at so why not?&lt;/span&gt;&lt;/h2&gt;

    		&lt;a class="featured" href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/featured.gif" alt="Inspect Element large preview" /&gt;&lt;/a&gt;

    		&lt;p&gt;Featured Project: &lt;a href="#"&gt;Inspect Element&lt;/a&gt;&lt;/p&gt;

    	&lt;/section&gt;

    	&lt;section id="portfolio"&gt; &lt;!-- HTML5 section tag for the portfolio 'section' --&gt;

    		&lt;h2 class="work"&gt;My Portfolio&lt;/h2&gt;

    		&lt;ul class="work"&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    			&lt;li&gt;
    				&lt;a href="<a class="linkifyplus" href="http://inspectelement.com">http://inspectelement.com</a>"&gt;&lt;img src="images/inspectelementSmall.jpg" alt="Inspect Element preview" /&gt;&lt;/a&gt;
    			&lt;/li&gt;
    		&lt;/ul&gt;

    	&lt;/section&gt;

    	&lt;section id="about"&gt; &lt;!-- HTML5 section tag for the about 'section' --&gt;

    		&lt;h2 class="about"&gt;About Me&lt;/h2&gt;

    		&lt;p&gt;Now this is a story all about how my life got twisted upside down and I'd like to take a minute just sit right there I'll tell you how I became the prince of a town called Bel-Air. In West Philadelphia born and raised on the playground my momma said most of my days chilling out, maxing and relaxing all cool and all shooting some b-ball outside of school when a couple of guys they were up to no good started making trouble in our neighbourhood I got in one little fight and my mom got scared, she said your moving in with your auntie and uncle in Bel-Air&lt;/p&gt;

    	&lt;/section&gt;

    	&lt;section id="contact"&gt; &lt;!-- HTML5 section tag for the contact 'section' --&gt;

    		&lt;h2 class="contact"&gt;Contact Me&lt;/h2&gt;

    		&lt;p&gt;I whistled for a cab and when it came near the license plate said fresh and had dice in the mirror, if anything I could say that this cab was rare but I thought nah, &lt;a href=""&gt;forget it&lt;/a&gt;, yo home to Bel-Air! I pulled up to the house about seven or eight I yelled to the cabbie yo home, smell you later, looked at my kingdom I was finally there to sit on my throne as the prince of Bel-Air&lt;/p&gt;

    		&lt;form id="contactform"&gt; 

    			&lt;p&gt;&lt;label for="name"&gt;Name&lt;/label&gt;&lt;/p&gt;
    			&lt;input type="text" id=name name=name placeholder="First and last name" required tabindex="1" /&gt; 

    			&lt;p&gt;&lt;label for="email"&gt;Email&lt;/label&gt;&lt;/p&gt;
    			&lt;input type="text" id=email name=email placeholder="<a class="linkifyplus" href="mailto:example@domain.com">example@domain.com</a>" required tabindex="2" /&gt; 

    			&lt;p&gt;&lt;label for="comment"&gt;Your Message&lt;/label&gt;&lt;/p&gt;
    			&lt;textarea name="comment" id="comment" tabindex="4"&gt;&lt;/textarea&gt; 

    			&lt;input name="submit" type="submit" id="submit" tabindex="5" value="Send Message" /&gt; 

    		&lt;/form&gt; 

    	&lt;/section&gt;

    	&lt;footer&gt; &lt;!-- HTML5 footer tag --&gt;

    		&lt;ul&gt;
    			&lt;li&gt;&lt;img src="images/twitter.png" alt="" /&gt;&lt;a href="<a class="linkifyplus" href="http://twitter.com/tkenny">http://twitter.com/tkenny</a>"&gt;Follow me on Twitter&lt;/a&gt;&lt;/li&gt;
    			&lt;li&gt;&lt;a href="<a class="linkifyplus" href="http://inspectelement.com/articles/code-a-backwards-compatible-one-page-portfolio-with-html5-and-css3">http://inspectelement.com/articles/code-a-backwards-compatible-one-page-portfolio-with-html5-and-css3</a>"&gt;Back to the Tutorial on Inspect Element&lt;/a&gt;&lt;/li&gt;
    		&lt;/ul&gt;

    	&lt;/footer&gt;	

    &lt;/section&gt;

&lt;/body&gt;

&lt;/html&gt;</span></code></pre>
<p><a href="http://inspectelement.com/html5portfolio/index.html">Download the HTML here</a> (Right-click and save as).</p>
<p>First thing first, let&#8217;s make sure the <a href="http://validator.w3.org/check?uri=http%3A%2F%2Finspectelement.com%2Fhtml5portfolio%2F">code validates</a> with W3C&#8217;s experimental HTML5 validator.</p>
<p><img class="alignnone size-full wp-image-6323" title="html5validate" src="http://inspectelement.com/wp-content/uploads/2010/01/html5validate.gif" alt="" width="555" height="28" /></p>
<p>Good news, it does! This is a simple example but good to know we&#8217;re on the right lines.</p>
<h3>The HTML5 Goodness</h3>
<p>As you can see from the code above there are new tags that you may not be familiar with. To make it even simpler here is the code stripped down to only the HTML5 tags.</p>
<pre><code>&lt;header&gt; &lt;!-- HTML5 header tag --&gt;

        &lt;nav&gt; &lt;!-- HTML5 navigation tag --&gt;
	&lt;/nav&gt;

&lt;/header&gt; 

&lt;section id="contentcontainer"&gt; &lt;!-- HTML5 section tag for the content 'section' --&gt;

	&lt;section id="intro"&gt; &lt;!-- HTML5 section tag for the introduction 'section' --&gt;
	&lt;/section&gt;

	&lt;section id="portfolio"&gt; &lt;!-- HTML5 section tag for the portfolio 'section' --&gt;
	&lt;/section&gt;

	&lt;section id="about"&gt; &lt;!-- HTML5 section tag for the about 'section' --&gt;
	&lt;/section&gt;

	&lt;section id="contact"&gt; &lt;!-- HTML5 section tag for the contact 'section' --&gt;
	&lt;/section&gt;

	&lt;footer&gt; &lt;!-- HTML5 footer tag --&gt;
	&lt;/footer&gt;	

&lt;/section&gt;</code></pre>
<h4>Header</h4>
<p>The first one you&#8217;ll notice is <strong>&lt;header&gt;</strong> and it does exactly what it implies. You can use this for the header of your page, typically containing the logo and the navigation.</p>
<blockquote><p>The header element represents a group of introductory or navigational aids.</p>
<p>A header element is intended to usually contain the section&#8217;s heading (an h1–h6 element or an hgroup element), but this is not required. The header element can also be used to wrap a section&#8217;s table of contents, a search form, or any relevant logos.</p></blockquote>
<p>The <a href="http://dev.w3.org/html5/spec/Overview.html#the-header-element">header</a> element as described in the HTML5 specs.</p>
<h4>Nav</h4>
<p>The <strong>&lt;nav&gt;</strong> tag now gives us the ability to highlight the navigation of a site through the HTML. Usually contained within the header of a page but can also be applied to left or right sided navigation in sidebars.</p>
<blockquote><p>The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links.</p>
<p>Not all groups of links on a page need to be in a nav element — only sections that consist of major navigation blocks are appropriate for the nav element. In particular, it is common for footers to have a short list of links to various pages of a site, such as the terms of service, the home page, and a copyright page. The footer element alone is sufficient for such cases, without a nav element.</p>
<p>User agents (such as screen readers) that are targeted at users who can benefit from navigation information being omitted in the initial rendering, or who can benefit from navigation information being immediately available, can use this element as a way to determine what content on the page to initially skip and/or provide on request.</p></blockquote>
<p>The <a href="http://dev.w3.org/html5/spec/Overview.html#the-nav-element">nav</a> element as described in the HTML5 specs</p>
<h4>Section</h4>
<p>In this example the <strong>&lt;section&gt;</strong> tag is being used to separate the different parts of the page. The introduction, my portfolio, about me and contact me areas are all sections that make up the page, all contained within a section tag.</p>
<blockquote><p>The section element represents a generic document or application section. A section, in this context, is a thematic grouping of content, typically with a heading.</p>
<p>Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site&#8217;s home page could be split into sections for an introduction, news items, contact information.</p></blockquote>
<p>The <a href="http://dev.w3.org/html5/spec/Overview.html#the-section-element">section</a> element as described in the HTML5 specs.</p>
<h4>Footer</h4>
<p>You&#8217;ll find the <strong>&lt;footer&gt;</strong> tag at the end of the contact section of the portfolio example. It&#8217;s included there and not at the end of the document in this case because it contains content relevant to the contact section in the form of the <a href="http://twitter.com/tkenny">Twitter link</a> (ignoring the back to tutorial link). For more information read the following included in the HTML 5 spec overview:</p>
<blockquote><p>The footer element represents a footer for its nearest ancestor sectioning content or sectioning root element. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like.</p>
<p>Contact information for the author or editor of a section belongs in an address element, possibly itself inside a footer.</p>
<p>Footers don&#8217;t necessarily have to appear at the end of a section, though they usually do.</p>
<p>When the footer element contains entire sections, they represent appendices, indexes, long colophons, verbose license agreements, and other such content.</p>
<p>The footer element is not sectioning content; it doesn&#8217;t introduce a new section.</p>
<p>When the nearest ancestor sectioning content or sectioning root element is the body element, then it applies to the whole page.</p></blockquote>
<p>The <a href="http://dev.w3.org/html5/spec/Overview.html#the-footer-element">footer</a> element as described in the HTML5 specs.</p>
<h4>The Form</h4>
<p>While the form itself doesn&#8217;t seem to be radically different to previous methods, HTML5 does introduce a nice addition in the placeholder <strong>attribute</strong>. Basically this fills in a text field with sample text much like we&#8217;re used to doing with Javascript now.</p>
<pre><code class="html"><span>&lt;input placeholder="<a class="linkifyplus" href="mailto:example@domain.com">example@domain.com</a>" /&gt;</span></code></pre>
<p>For more on HTML5 in forms make sure you check out <a href="http://24ways.org/2009/have-a-field-day-with-html5-forms">Have a Field Day with HTML5 Forms</a> on last year&#8217;s 24 ways.</p>
<h3>Backwards Compatibility</h3>
<p>All of this is great. We&#8217;re using the latest and greatest technology in web development but currently only a few browsers support HTML5 in any capacity. We now need to think about all versions of Internet Explorer which don&#8217;t include any support for HTML5 whatsoever. Fortunately for us, Remy Sharp has created a <a href="http://remysharp.com/2009/01/07/html5-enabling-script/">Javascript file</a> that reverses IE&#8217;s inability to style elements it doesn&#8217;t recognise.</p>
<p>Just included the following code:</p>
<pre><code><span>&lt;!--[if IE]&gt;
&lt;script src="<a class="linkifyplus" href="http://html5shiv.googlecode.com/svn/trunk/html5.js">http://html5shiv.googlecode.com/svn/trunk/html5.js</a>"&gt;&lt;/script&gt;
&lt;![endif]--&gt;</span></code></pre>
<p>Now that all major browsers will recognise the styling let&#8217;s move onto the CSS.</p>
<h3>The CSS3 Goodness</h3>
<p>Most of the CSS won&#8217;t be new to you but there are a few CSS3 properties that we&#8217;ll have a look at including gradients, embeddable fonts and text shadow.</p>
<p><a href="http://inspectelement.com/html5portfolio/style.css">View the CSS here</a></p>
<p>Let&#8217;s begin by looking at how this page behaves visually in a browser that supports CSS3. <a href="http://inspectelement.com/html5portfolio/">View the demo</a> in the latest versions of Safari, Chrome or Firefox to see the full effect. Or see the screenshots below:</p>
<p><img class="alignnone size-full wp-image-6375" title="logo" src="http://inspectelement.com/wp-content/uploads/2010/01/logo.jpg" alt="" width="401" height="115" /></p>
<p><img class="alignnone size-full wp-image-6373" title="about" src="http://inspectelement.com/wp-content/uploads/2010/01/about.jpg" alt="" width="523" height="334" /></p>
<p><img class="alignnone size-full wp-image-6374" title="form" src="http://inspectelement.com/wp-content/uploads/2010/01/form.jpg" alt="" width="471" height="250" /></p>
<h4>@font-face</h4>
<p>While this example uses @font-face on every instance of text, I wouldn&#8217;t recommend doing so on large websites. Also, using some fonts as body text may case text to become hard to read. Don&#8217;t get carried away. This theme uses <a href="http://www.yanone.de/typedesign/kaffeesatz/">Yanone Kaffeesatz</a> at a large enough size to make it very readable and differ enough from the regular web-safe fonts.</p>
<pre><code>@font-face { font-family: Keffeesatz; src: url(YanoneKaffeesatz-Light.otf) format("opentype") }
@font-face { font-family: KeffeesatzBold; src: url(YanoneKaffeesatz-Bold.otf) format("opentype") }</code></pre>
<h4>RGBa</h4>
<p>With RGBa you can declare a colour and an opacity as a single property. Not only that but it can be applied to anything that uses colour. To demonstrate this, the image link and input borders have RGBa applied. You can see the subtle background texture show through, especially noticeable on the input elements in the form.</p>
<pre><code>input[type="text"] { border: 5px solid rgba(122, 192, 0, 0.15); }</code></pre>
<p>The first three values (122, 192, 0) are the red, green and blue values of the colour with the fourth (0.15) being the alpha value, or opacity.</p>
<p>Where it can be seen in the example:</p>
<ul>
<li>Logo (subtle border top and bottom)</li>
<li>Image link borders</li>
<li>Input borders</li>
</ul>
<h4>Gradients</h4>
<p>WebKit started the support of CSS gradients and Mozilla have followed suit and implement a slightly different way of generating them but support is there. Make sure to set a standard background colour for browsers that don&#8217;t support RGBa. The example below shows a linear gradient going from bottom-to-top.</p>
<pre><code>h1 a {
background: -webkit-gradient(
    linear,
    left bottom,
    left top,
    color-stop(0.23, #c34000),
    color-stop(0.62, #ff5400)
);
background: -moz-linear-gradient(
    center bottom,
    #c34000 23%,
    #ff5400 62%
);
}</code></pre>
<p>Where it can be seen in the example:</p>
<ul>
<li>Logo</li>
<li>Button</li>
</ul>
<h4>Text-Shadow</h4>
<p>A great addition to CSS3 used in the one page portfolio to add a touch of depth to the text on the page lifting it slightly from the patterned background.</p>
<pre><code>body { text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); }</code></pre>
<p>The first value is the horizontal distance, the second the vertical and the third how much blur is applied. The fourth value here is the previously mentioned RGBa. Both WebKit and firefox recognise the single declaration above which is nice.</p>
<p>Where it can be seen in the example:</p>
<ul>
<li>Everywhere (expect input text and)</li>
</ul>
<h4>Box-Shadow</h4>
<p>Be aware that the box-shadow CSS3 property has been <a href="http://www.w3.org/blog/CSS/2009/10/01/resolutions_79">dropped</a> from the CSS3 specs for now but it still works fine in WebKit and the latest versions of Firefox.</p>
<pre><code>header {
-webkit-box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
}</code></pre>
<p>Where it can be seen in the example:</p>
<ul>
<li>Logo</li>
<li>Header</li>
<li>Hovering over image links</li>
<li>Hovering over input fields</li>
<li>Form button</li>
</ul>
<h4>Border-Radius</h4>
<p>Probably the most used CSS3 property in the wild right now and very simply implemented as the code shows below:</p>
<pre><code>h1 a {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}</code></pre>
<p>Where it can be seen in the example:</p>
<ul>
<li>Logo</li>
<li>Button</li>
<li>Borders that use RGBa in WebKit</li>
</ul>
<h4>Selection Colour</h4>
<p>Briefly <a href="http://inspectelement.com/didyouknow/change-the-browser-default-selection-appearance/">covered on Inspect Element before</a>, CSS3 gives us the ability to change the colour or background colour, or both, of selected text with the following code:</p>
<pre><code>::selection { background-color: rgba(122, 192, 0, 0.2); }
::-moz-selection { background-color: rgba(122, 192, 0, 0.2); }</code></pre>
<h3>So then, Internet Explorer&#8230;</h3>
<p>Let&#8217;s have a look at how this looks in our good old friend, Internet Explorer:</p>
<p><img class="alignnone size-full wp-image-6409" title="IE_html5portfolio" src="http://inspectelement.com/wp-content/uploads/2010/01/IE_html5portfolio.jpg" alt="" width="555" height="444" /></p>
<p><img class="alignnone size-full wp-image-6408" title="IE_contact" src="http://inspectelement.com/wp-content/uploads/2010/01/IE_contact.jpg" alt="" width="555" height="444" /></p>
<p>As you can see it doesn&#8217;t look quite as good as intended but it still looks really good. Don&#8217;t forget that the average visitor looking at sites in Internet Explorer typically don&#8217;t open it up in different browsers and compare the two so they&#8217;re none the wiser. It&#8217;s still perfectly readable and usable.</p>
<p>The possible exception is the logo, where you may want to save it as an image so it displays 100% as intended in all browsers.</p>
<h3>jQuery</h3>
<p>This extremely <a href="http://www.position-absolute.com/articles/better-html-anchor-a-jquery-script-to-slide-the-scrollbar/">simple method</a> of smooth scrolling using jQuery is used and makes navigation much more interesting.</p>
<h3>Can I have the .psd File please?</h3>
<p>You may be wondering where the Photoshop or Fireworks file is. Well, there isn&#8217;t one. This is a result of designing in the browser and shows what can be achieved when skipping the Photoshop design phase, saving a lot of time in the process.</p>
<p style="font-size: 24px;"><a style="font-size: 24px;" href="http://inspectelement.com/html5portfolio/">View Demo</a> | <a style="font-size: 24px;" href="http://inspectelement.com/html5portfolio/HTML5_portfolio.zip">Download Files (.zip)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://inspectelement.com/tutorials/code-a-backwards-compatible-one-page-portfolio-with-html5-and-css3/feed/</wfw:commentRss>
		<slash:comments>97</slash:comments>
		</item>
	</channel>
</rss>

