Snippets: HTML5 Template & CSS Reset

Snippets: HTML5 Template & CSS Reset
October 21, 20106 Comments

If you haven't started using HTML5 for markup in your projects, now is always a good time to start. There are tons of good tutorials and posts out there that will teach you all about the new spec.

I just wanted to share a simple HTML5 template and CSS reset I use to start out each new project in hopes someone would find it useful. It contains the basic layout formula, stylesheets, latest version of jQuery, Remy Sharp's html5shim and Google Analytics code.

You can also grab the snippets and others from my Snipplr page here.

HTML5 Starting Point Template

<!DOCTYPE html>
<html lang="en">
	<meta charset="utf-8" />
	<meta name="description" content="A description about your site" />
	<meta name="keywords" content="keywords, separated, by, comma" />
	<title>Untitled Document</title>
	<link rel="shortcut icon" href="favicon.ico" />
	<link rel="stylesheet" href="css/style.css" media="screen" />
	<link rel="stylesheet" href="css/print.css" media="print" />
	<link rel="stylesheet" href="css/mobile.css" media="handheld" />
	<script src=""></script>
	<!--[if IE]>
		<script src=""></script>

	<section id="header">
			<h1><a href="#">Site Title</a></h1>
					<li><a href="#">Home</a></li>
					<li><a href="#">About</a></li>
					<li><a href="#">Contact</a></li>

	<section id="main">
				<a href="#">
					<h1>Heading Title</h1>
					<h2>Heading Title 2</h2>
			<p>Article Filler</p>
			Sidebar Filler

	<section id="footer">
			&copy; Copyright Year by Author. All Rights Reserved.

	<script type="text/javascript">
		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', 'XX-XXXXXXX-XX']);

		(function() {
			var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

CSS Reset

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;font-weight:normal;}ol,ul,nav ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary{display:block;}input,select{vertical-align:middle;}abbr[title],dfn[title]{border-bottom:1px dotted #000;cursor:help;}hr{display:block;height:1px;border:0;border-top:1px solid #cccccc;margin:1em 0;

Author: Jason

Hi, I'm Jason. A front end developer from Grand Rapids, Michigan, and founder of VagrantRadio. I enjoy working with Css, jQuery, Php, learning new techniques in Photoshop and you should follow me on Twitter or Snipplr.

Mojo Themes
  • AoSiX
    <a href="#">
          Heading Title
          Heading Title 2

    <a> can’t contain ; this is bad :O

    • VagrantRadio

      AoSiX, I’m afraid I don’t see a “;” in there, but I assure you this is the correct syntax for a linked hgroup.

      Also, had to reformat your comment to make it display properly. Next time when writing code, use <pre> </pre> and & lt ; – &gt ; for brackets.

  • Will Ayers

    I would suggest adding a blank IE conditional statement right after the title like so:

    This will prevent from any of the other conditional statements from acting like scripts and stopping all other downloads until complete.

    • VagrantRadio

      Hey Will,

      Looks like your code got stripped out if there was any. Thanks for the suggestion!

  • VagrantRadio

    So what’s the point of this? I guess I fail to see what it does, the other IE conditional in there is a script.

Scroll to top