<?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>Aaron Mentele, Charisma 18 &#187; html5 css3</title>
	<atom:link href="http://aaronmentele.com/tag/html5-css3/feed/" rel="self" type="application/rss+xml" />
	<link>http://aaronmentele.com</link>
	<description>personal blog of Aaron Mentele, web developer and partner at Electric Pulp</description>
	<lastBuildDate>Fri, 19 Mar 2010 22:14:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTML5, again</title>
		<link>http://aaronmentele.com/2010/03/17/html5-again/</link>
		<comments>http://aaronmentele.com/2010/03/17/html5-again/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 21:49:03 +0000</pubDate>
		<dc:creator>Aaron Mentele</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[html5 css3]]></category>

		<guid isPermaLink="false">http://aaronmentele.com/?p=896</guid>
		<description><![CDATA[If you&#8217;re a front-end developer, I want you to do me a favor. I want you to pick a project and mark it up in html5. I&#8217;m not going to ask you to code a game experience inside the canvas element or replicate a youtube video player or do anything really, except challenge you to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a front-end developer, I want you to do me a favor. I want you to pick a project and mark it up in html5. I&#8217;m not going to ask you to code a game experience inside the canvas element or replicate a youtube video player or do anything really, except challenge you to declare semantic information about your content blocks.</p>
<p>This is a <code>&lt;header&gt;</code>. This is a <code>&lt;section&gt;</code>. This is a <code>&lt;footer&gt;</code>. Et cetera.</p>
<p>What I heard at southby any time it came up was that HTML5 wasn&#8217;t worth the extra effort. I didn&#8217;t hear a single dev concerned with browser compatibility or the possibility of the spec changing. Just effort. And that&#8217;s bullshit. You&#8217;re changing a doctype and working with a few extra block elements.</p>
<p>I&#8217;m going to bonus you out, though, to help convince you to do it. This all comes together and opens up a foundation for certain CSS3 enhancements. You&#8217;ve heard of @font-face, right? Yeah, read on.</p>
<h2>Switching the doctype</h2>
<p>It feels sexy being able to type your doctype by hand. If you aren&#8217;t already doing it, try it. <code>&lt;!DOCTYPE html&gt;</code> Sexy. </p>
<p>Declaring your character set just got simpler, too. <code>&lt;meta charset=&quot;UTF-8&quot; /&gt;</code></p>
<p>Some of you noticed I closed that tag. I like XHTML. Maybe you don&#8217;t. You can do it either way.</p>
<h2>Tricking out your blocks</h2>
<p>You can tell yourself all you want that your id&#8217;s and classnames are already informing people and bots of the content type within, but you&#8217;d be kidding yourself. Div&#8217;s are for suckers. They provide no semantic information to the untrained audience. You could say the same of html5, except that it really is <strong>standard</strong>.</p>
<p>For those who haven&#8217;t read through the spec, here&#8217;s an example skel template:<br />
<pre><code class="code">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&nbsp;&nbsp;&lt;head&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Boom&lt;/title&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta charset=&quot;UTF-8&quot; /&gt;
&nbsp;&nbsp;&lt;/head&gt;
&nbsp;&nbsp;&lt;body&gt;
&nbsp;&nbsp;&lt;header id=&quot;header&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;hgroup&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;BOOM&lt;/h1&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&gt;I&#039;m using HTML5!&lt;/h2&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/hgroup&gt;
&nbsp;&nbsp;&lt;/header&gt;
&nbsp;&nbsp;&lt;nav&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;a link&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;a link&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;
&nbsp;&nbsp;&lt;/nav&gt;
&nbsp;&nbsp;&lt;section id=&quot;content&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;article&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;header&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h3&gt;Implementing new markup is fun.&lt;/h3&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/header&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;I can&#039;t believe how excited I am right now.&lt;/p&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;aside&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Related: I like CSS3 too, but Imma let you finish.&lt;/p&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/aside&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;footer&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;I don&#039;t have a footer. This shouldn&#039;t even be here.&lt;/p&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/footer&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/article&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;aside id=&quot;sidebar&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h3&gt;Archives&lt;/h3&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;Sooper interesting story.&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;Very interesting story.&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/aside&gt;
&nbsp;&nbsp;&lt;/section&gt;
&nbsp;&nbsp;&lt;footer id=&quot;footer&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;No rights reserved.&lt;/p&gt;
&nbsp;&nbsp;&lt;/footer&gt;
&nbsp;&nbsp;&lt;/body&gt;
&lt;/html&gt;
</code></pre></p>
<p>Simple. There isn&#8217;t much guesswork involved in deciding which elements to use where. I typed that out without grabbing from an existing project just to make sure I can say this: <strong>IT DOES NOT TAKE ANY LONGER THAN CODING IN HTML4 OR XHTML</strong>.</p>
<p>BTW, maybe you spotted some seemingly redundant id&#8217;s up there. (E.g., <code>&lt;header id=&quot;header&quot;&gt;</code>) I did too, but I like to keep specificity basic, and we&#8217;re allowing for multiple uses of the same elements. I also have some carry-over habits from my time with divs, and, like I mentioned above, I&#8217;m not asking you to throw out any of your practices. I&#8217;m just suggesting you can enhance them.</p>
<h2>Browser Compatibility</h2>
<p>You&#8217;re right to be concerned about browser compatibility. There is a whole gaggle of browsers that won&#8217;t recognize these new elements. We need to declare them in our css:<br />
<pre><code class="code">
header, nav, article, section, figure, aside, footer { display: block; }
time { display: inline; }
</code></pre></p>
<p>That won&#8217;t be enough. Most of you have probably heard of the HTML5 shiv that lets you style these new elements in IE. Ignore it. Go get <a href="http://www.modernizr.com/">modernizr</a> instead. Call it:<br />
<pre><code>
&lt;script src=&quot;/js/modernizr-1.1.min.js&quot;&gt;&lt;/script&gt;
</code></pre></p>
<p>Done. You&#8217;re using HTML5. Your site is also now jacked in Firefox 2 and Opera 1, but we&#8217;re all grown-ups here. You&#8217;ll also notice some js targeting issues in IE, so you might want to keep using divs for slideshows and the like. But I hate to even mention these things. Issues will be extremely rare.</p>
<h2>Bonus! Progressive CSS</h2>
<p>This is going to seem like I&#8217;m throwing you for a loop, but stick with me &#8212; this is the bonus I promised. Now that you&#8217;re using Modernizr, you have browser evaluation for CSS3 features already happening. Take a look at (inspect) your html tag. You&#8217;ll see classes for something like 24 new properties such as rgba, borderradius, cssgradient, and fontface.</p>
<p>Let&#8217;s focus on the last one. </p>
<p>One of the things holding us back from using @font-face was browser (in)consistency. We could add to the font stack, but we couldn&#8217;t modify the characteristics if we had to fall back from a narrow font, for instance, to something wider like websafe Helvetica. Now we can.</p>
<p><pre><code class="code">
@font-face {
font-family: &#039;Snowflake&#039;;
src: url(&#039;/fonts/SNOWN___.eot&#039;);
src: local(&#039;Snowflake Normal&#039;), local(&#039;SnowflakeNormal&#039;), 
url(&#039;/fonts/SNOWN___.woff&#039;) format(&#039;woff&#039;), 
url(&#039;/fonts/SNOWN___.ttf&#039;) format(&#039;truetype&#039;), 
url(&#039;/fonts/SNOWN___.svg#:SnowflakeNormal&#039;) format(&#039;svg&#039;);
}

h1 {
&nbsp;&nbsp;font-family:&#039;:SnowflakeNormal&#039;, Helvetica, Arial, sans-serif;
&nbsp;&nbsp;font-size:2em;
&nbsp;&nbsp;font-weight:200;/* this is an attempt to bust ClearType rules */
&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;.no-fontface h1 {
&nbsp;&nbsp;&nbsp;&nbsp;font-family:Helvetica, Arial, sans-serif;
&nbsp;&nbsp;&nbsp;&nbsp;font-size:1.5em;
&nbsp;&nbsp;}
</code></pre><br />
The .no-fontface class allows us to specify variations to the characteristics we&#8217;ve set if the browser in question can&#8217;t handle @font-face. I&#8217;m looking at you, FF3.</p>
<p>Sorry to drop all that as an offhand bonus. I realize if you haven&#8217;t played with @font-face yet this might seem like a bit to digest. But <a href="http://www.fontsquirrel.com/">FontSquirrel</a> is going to let you find <em>free</em> fonts as well as help you bundle them up for use. The @font-face code above (basically) comes from FontSquirrel. If you want to read a bit more, I wrote about it <a href="http://aaronmentele.com/2009/12/10/melting/">here</a>. </p>
<p>Two disclaimers: 1. You&#8217;re going to want to get your font into photoshop / fireworks / whatever prior to build. Trying to find a close match after the fact will make your head explode. 2. You&#8217;re going to hate Firefox 3. It won&#8217;t support @font-face whatever you do, and your visitors&#8217; browser stats might make you question your use. If this bothers you, fall back to Cufón.</p>
<h2>Anyway&#8230;</h2>
<p>I don&#8217;t buy HTML5 not being worth any coder&#8217;s time. It&#8217;s easy to implement, and it&#8217;s scary to think that some of the brightest authors are going to wait for the spec to be finalized before they get in to try it out.</p>
<p>We&#8217;ve launched six projects using html5 and @font-face now, by the way, and are about to launch six more. I&#8217;d love to hear if any of you are using it as well. Maybe you&#8217;re doing it way better than I. I&#8217;d love to steal your ideas.</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronmentele.com/2010/03/17/html5-again/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>
