Code a Backwards Compatible, One Page Portfolio with HTML5 and CSS3

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. Before we start, make note of the answer to this question. Do websites need to look exactly the same in every browser?

View Demo | Download Files (.zip)

The HTML

<!DOCTYPE html>
<html lang="en">

<!-- This is a demonstration of HTML5 goodness with healthy does of CSS3 mixed in -->
<head>

    <title>One Page Portfolio</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

    <!--[if IE]>
    	<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!--[if IE 7]>
    	<link rel="stylesheet" href="ie7.css" type="text/css" media="screen" />
    <![endif]-->

    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js" type="text/javascript"></script>
    <script src="js/jquery.anchor.js" type="text/javascript"></script>
    <script src="js/jquery.fancybox-1.2.6.pack.js" type="text/javascript"></script>

</head>

<body>

    <header> <!-- HTML5 header tag -->

    	<div id="headercontainer">

    		<h1><a class="introlink anchorLink" href="#intro">Web Design Portfolio</a></h1>

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

    	</div>

    </header>

    <section id="contentcontainer"> <!-- HTML5 section tag for the content 'section' -->

    	<section id="intro">

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

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

    		<p>Featured Project: <a href="#">Inspect Element</a></p>

    	</section>

    	<section id="portfolio"> <!-- HTML5 section tag for the portfolio 'section' -->

    		<h2 class="work">My Portfolio</h2>

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

    	</section>

    	<section id="about"> <!-- HTML5 section tag for the about 'section' -->

    		<h2 class="about">About Me</h2>

    		<p>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</p>

    	</section>

    	<section id="contact"> <!-- HTML5 section tag for the contact 'section' -->

    		<h2 class="contact">Contact Me</h2>

    		<p>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, <a href="">forget it</a>, 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</p>

    		<form id="contactform"> 

    			<p><label for="name">Name</label></p>
    			<input type="text" id=name name=name placeholder="First and last name" required tabindex="1" /> 

    			<p><label for="email">Email</label></p>
    			<input type="text" id=email name=email placeholder="example@domain.com" required tabindex="2" /> 

    			<p><label for="comment">Your Message</label></p>
    			<textarea name="comment" id="comment" tabindex="4"></textarea> 

    			<input name="submit" type="submit" id="submit" tabindex="5" value="Send Message" /> 

    		</form> 

    	</section>

    	<footer> <!-- HTML5 footer tag -->

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

    	</footer>	

    </section>

</body>

</html>

Download the HTML here (Right-click and save as).

First thing first, let’s make sure the code validates with W3C’s experimental HTML5 validator.

Good news, it does! This is a simple example but good to know we’re on the right lines.

The HTML5 Goodness

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.

<header> <!-- HTML5 header tag -->

        <nav> <!-- HTML5 navigation tag -->
	</nav>

</header> 

<section id="contentcontainer"> <!-- HTML5 section tag for the content 'section' -->

	<section id="intro"> <!-- HTML5 section tag for the introduction 'section' -->
	</section>

	<section id="portfolio"> <!-- HTML5 section tag for the portfolio 'section' -->
	</section>

	<section id="about"> <!-- HTML5 section tag for the about 'section' -->
	</section>

	<section id="contact"> <!-- HTML5 section tag for the contact 'section' -->
	</section>

	<footer> <!-- HTML5 footer tag -->
	</footer>	

</section>

Header

The first one you’ll notice is <header> and it does exactly what it implies. You can use this for the header of your page, typically containing the logo and the navigation.

The header element represents a group of introductory or navigational aids.

A header element is intended to usually contain the section’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’s table of contents, a search form, or any relevant logos.

The header element as described in the HTML5 specs.

Nav

The <nav> 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.

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.

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.

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.

The nav element as described in the HTML5 specs

Section

In this example the <section> 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.

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.

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’s home page could be split into sections for an introduction, news items, contact information.

The section element as described in the HTML5 specs.

Footer

You’ll find the <footer> tag at the end of the contact section of the portfolio example. It’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 Twitter link (ignoring the back to tutorial link). For more information read the following included in the HTML 5 spec overview:

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.

Contact information for the author or editor of a section belongs in an address element, possibly itself inside a footer.

Footers don’t necessarily have to appear at the end of a section, though they usually do.

When the footer element contains entire sections, they represent appendices, indexes, long colophons, verbose license agreements, and other such content.

The footer element is not sectioning content; it doesn’t introduce a new section.

When the nearest ancestor sectioning content or sectioning root element is the body element, then it applies to the whole page.

The footer element as described in the HTML5 specs.

The Form

While the form itself doesn’t seem to be radically different to previous methods, HTML5 does introduce a nice addition in the placeholder attribute. Basically this fills in a text field with sample text much like we’re used to doing with Javascript now.

<input placeholder="example@domain.com" />

For more on HTML5 in forms make sure you check out Have a Field Day with HTML5 Forms on last year’s 24 ways.

Backwards Compatibility

All of this is great. We’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’t include any support for HTML5 whatsoever. Fortunately for us, Remy Sharp has created a Javascript file that reverses IE’s inability to style elements it doesn’t recognise.

Just included the following code:

<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Now that all major browsers will recognise the styling let’s move onto the CSS.

The CSS3 Goodness

Most of the CSS won’t be new to you but there are a few CSS3 properties that we’ll have a look at including gradients, embeddable fonts and text shadow.

View the CSS here

Let’s begin by looking at how this page behaves visually in a browser that supports CSS3. View the demo in the latest versions of Safari, Chrome or Firefox to see the full effect. Or see the screenshots below:

@font-face

While this example uses @font-face on every instance of text, I wouldn’t recommend doing so on large websites. Also, using some fonts as body text may case text to become hard to read. Don’t get carried away. This theme uses Yanone Kaffeesatz at a large enough size to make it very readable and differ enough from the regular web-safe fonts.

@font-face { font-family: Keffeesatz; src: url(YanoneKaffeesatz-Light.otf) format("opentype") }
@font-face { font-family: KeffeesatzBold; src: url(YanoneKaffeesatz-Bold.otf) format("opentype") }

RGBa

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.

input[type="text"] { border: 5px solid rgba(122, 192, 0, 0.15); }

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.

Where it can be seen in the example:

  • Logo (subtle border top and bottom)
  • Image link borders
  • Input borders

Gradients

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’t support RGBa. The example below shows a linear gradient going from bottom-to-top.

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%
);
}

Where it can be seen in the example:

  • Logo
  • Button

Text-Shadow

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.

body { text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); }

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.

Where it can be seen in the example:

  • Everywhere (expect input text and)

Box-Shadow

Be aware that the box-shadow CSS3 property has been dropped from the CSS3 specs for now but it still works fine in WebKit and the latest versions of Firefox.

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);
}

Where it can be seen in the example:

  • Logo
  • Header
  • Hovering over image links
  • Hovering over input fields
  • Form button

Border-Radius

Probably the most used CSS3 property in the wild right now and very simply implemented as the code shows below:

h1 a {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

Where it can be seen in the example:

  • Logo
  • Button
  • Borders that use RGBa in WebKit

Selection Colour

Briefly covered on Inspect Element before, CSS3 gives us the ability to change the colour or background colour, or both, of selected text with the following code:

::selection { background-color: rgba(122, 192, 0, 0.2); }
::-moz-selection { background-color: rgba(122, 192, 0, 0.2); }

So then, Internet Explorer…

Let’s have a look at how this looks in our good old friend, Internet Explorer:

As you can see it doesn’t look quite as good as intended but it still looks really good. Don’t forget that the average visitor looking at sites in Internet Explorer typically don’t open it up in different browsers and compare the two so they’re none the wiser. It’s still perfectly readable and usable.

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.

jQuery

This extremely simple method of smooth scrolling using jQuery is used and makes navigation much more interesting.

Can I have the .psd File please?

You may be wondering where the Photoshop or Fireworks file is. Well, there isn’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.

View Demo | Download Files (.zip)

Author

I'm the creater of Inspect Element and currently work as a senior web designer and developer for Factory Media. You can read my personal blog and follow me on Google+ and Twitter.

Discussion

  1. Mil says:

    Very thorough, and well-written.

    Keep it up.

  2. Mihai O. says:

    Great article, but the download link doesn’t work ;)

  3. Hi Tom, well done and very informative. As to your first question (do website need to look the same in every browser), my personal opinion (and answer) is “no, they don’t”, in fact I enjoy seeing how different websites can look in different browsers and how new techniques can change the little things that make the difference in the end. But I’m a web designer! I have fun discovering what’s new and experimenting a little bit with CSS and XHTML, jQuery and Ajax. In my experience, clients see it just the opposite…to make it very simple -moz-border-radius will generate the question “why my site has squared borders in IE?”

  4. Matthew says:

    Saying that sites don’t need to look the same in every browser is not strictly true, it depends on the site.

    Personally…
    - Sites do not need to be pixel perfect in every browser
    - Some extra features of new browsers are god and degrade nicely.

    However…
    If you do an AB test to see if having a box shadow round something improves your sales, then the box shadow must look the same in all browsers, otherwise the test is pointless.

    • Rio says:

      If you point it to IE, the best solution is to use conditional statement for that crappy browser :] that way you can still make it look the same in this browser, while you use the modern approach.

      Don’t let IE and other old browsers that don’t support web standards make you stuck and let you hate HTML5 and CSS3. There are so much fun in them :]

  5. Oliv G. says:

    Yeah great article. if I had had this article for my site earlier, it would have been very helpful:)

  6. Elena says:

    Thank you for this. It’s such a thorough tutorial. This is a great intro to these new languages.

  7. Rett says:

    Thanks for the great post Tom. I was nodding in agreement up until the last part about not having a psd. I won’t argue about the end product because it does look great, but I think no matter the size of a project, it’s imperative to have a “design phase.”

    Before even getting on the computer and firing up Photoshop or Illustrator I’m a big fan of pencil on paper as that’s the quickest way to churn out a bunch of ideas and force yourself to explore new ways of doing things. And then once on the computer I really think taking the time in Photoshop is the best way to make sure that you don’t take any shortcuts. My experience with jumping straight to the browser is that you tend to “settle” and think, eh, it’s good enough. Whereas if you have a psd you will make sure to match it pixel for pixel.

    Anyway, just wanted to throw that out there for any of the younger designers out there who are tempted to skip the design phase, and say that my opinion is DON’T EVER :)

  8. Erik Ford says:

    I think it is important for all of us to begin to familiarize ourselves with HTML5 tags to get a “leg up”. But, I question whether or not this should be implemented for a client globally on a website before the specs have been approved and incorporated into the future releases of modern browsers?

    Otherwise, the promise of HTML5 has me extremely excited for the bright future ahead of us.

  9. Amanda Kay says:

    “You may be wondering where the Photoshop or Fireworks file is. Well, there isn’t one.” – Great point! I’m always glad to know of others who code in this way. Also the use of CSS-based effects ensures the site is not weighed down by large image files and calls to the server.

    Well written and thought-provoking – thanks for publishing this!

  10. Faruk Ate? says:

    Hi Tom,

    Have you seen Modernizr? Might be useful for you :-)

    http://www.modernizr.com/

    -Faruk

  11. That’s a well written introduction to HTML5… really appreciate it! Thanks.

    Would you mind using your files as a template for my personal page (giving credit of course)? It’s well structured and would serve perfectly my needs.

  12. Jann says:

    I’m retired now, but when I was designing for our company [large IT corporation] it was REQUIRED that our designs looked the same in the specified, popular browsers. In other words the users experience HAD to be the same no matter which browser they were using.

    This was a good article…a nice way to introduce HTML5.

  13. Michael says:

    Huh… interesting… looks very much like my site. I also posted a blog about HTML5 &CSS3 Backwards Compatibility have you seen it?

  14. Fabio says:

    Very informative and useful tutorial, really a great way to plunge into html5.
    I was wondering, however, whether it’s possible to highlight the active section on the navbar, I can see only 2 states – link and hover, but there’s no way to have a different color for the link of the active section. Maybe with jquery can we append dynamically a class and style it differently?
    Thanks if you can answer this question, but thanks even if you can’t, anyway a great tutorial.
    cheers!

    • michael says:

      I don’t know why you would want to do such a thing. When would you be selecting text and clicking on a menu button simultaneously? I don’t think that’s possible. These are the current pseudo-classes available to use. The [ ::selection ] pseudo-classes is intended only to change the color of selected text. Try selecting the text on this page and you’ll see what I mean.

      a:link /* unvisited link */
      a:visited /* visited link */
      a:hover /* mouse over link */
      a:active /* selected link */

      • Fabio says:

        maybe I wasn’t able to explain what I mean: say you click on “portfolio”, you go to the portfolio section, but no item on the navbar is highlighted or styled in a different way.
        In a everyday use of a site, when you go to a new page you’d like to have the part of the navbar that “brought” you on that page styled in a different way.
        Usually you get this effect with a css sprite with 3 states: one for the link status, one for the hover and the third for the active page you are on (I don’t mean the a:active pseudo class, but a class you give to the body element or to a single item on your navbar, call it active or current, or whatever). I wanted to get this effect but I can’t, since there is only one page here and I can’t target an element on the page to make it the current section.
        So my question was if there’s a way to get a new class in a dynamic way, that’s all..and by the way, thank you, but I know a little bit of CSS and I was aware of the existence of pseudo classes..;)

        • Tom Kenny says:

          I see what you mean and it’s possible you could do something with JavaScript on the example portfolio here but I fail to see why would want to. The problem is that you’re only on a section, not a page. As soon as you scroll away from the section you’re on, you would need to work out where the visitor is.

          One way around this is to redesign with the navigation repeated at the top of each section rather than at the top of the page itself. This way you can highlight the section that the navigation relates to.

  15. Shawn K. says:

    Thanks for separating the HTML5, that’s what actually caught my attention to read the article.

    I guess I’ve been avoiding HTML5 due to everyone trying to use it as an alternative to Flash…when many browsers still wont display HTML5 to it’s full extent.
    One of the many reasons to hate Internet Explorer, it tends to hold back web standards from evolving.

  16. Sandy says:

    I really think there’s a place for browser-based design. When everyone seems to be throwing images around the place, a good layout and some smart coding can easily produce a more fresh looking website. I haven’t yet used HTML5 or CSS3, but it’s great to have a breakdown such as this.

  17. fosron says:

    Cool tutorial, and a really awesome result, but there’s one problem with your layout, and to be exact, with use of tag. You can’t use it like this , this one should be a div. I’m saying should because the HTML5 draft says that section is for CONTENT not for STYLING, and to follow the draft or not, is your decision :) I really love the CSS3 goodies, and damn, i hate IE even more now ^^

  18. fosron says:

    i was talking about {section} tag , and {section id=”contentcontainer”} , forgot that WP strips tags out ^^

    • dawn reel says:

      this is interesting, but i don’t understand, could you please describe what you mean that “WordPress strips tags out? I am about to make my first WP.org site and feel this is imp to understand– thank you

  19. mike says:

    I came here to say what fosron said.

    SECTION is a semantic tag for defining sections of text and content, yet you are using a SECTION tag (section id=”contentcontainer” to be exact) in the same way we used to use DIV tags. This is incorrect. The correct method would be to replace that one section tag with a DIV, or replace it with an ARTICLE tag… however, again the article tag is really only for grouping several articles on one page (think a blog for example)… my advice, replace the SECTION tag with a DIV to stick to the HTML5 spec.

    Otherwise a nice writeup.

  20. erikdana says:

    Hey,
    by some reason the intro image was pushed to the right, it’s in the same line as the subtitle “It’s what I’m good at so why not?” … Looks like there should be a line break there. Weird.

    I’m using firefox 3.6 on linux btw

  21. Dan says:

    Nice introduction to HTML5 and CSS3. I am of the opinion that a site should look identical in all browsers, but maybe that’s just because I’ve done my time making sure everything works in IE6, and it’s so much easier to ensure they do look the same these days.

    It’s interesting to note that some of the CSS3 effects like drop-shadows etc were present in IE way back. They weren’t great, but MS were actually ont he right track including those sorts of ideas. Hopefully in the next 3-5 years we’ll actually be able to use them via CSS3.

    Nice job @fosron and @mike for clearing up a few issues.

  22. Very nice tutorial and one pager. Thank you very much for sharing.

  23. Greg Babula says:

    Awesome tutorial, thanks

  24. Greg says:

    thanks for the great tutorial. this is exactly what i was looking for – working on a redesign of my site w/ a similar layout and you just helped tremendously with keeping it clean and up-to-date.

    one question i had was about testing it on an iphone or ipad. the header+navigation scrolls away w/ the rest of the content. i was just curious if there’s a way to make it stick like in the desktop browser experience, at the top?

  25. Gary says:

    Awesome! Thank you for putting this out for us all to study.

  26. tom says:

    Hi,

    really nice tut out there. Just one question..

    Is it possible to make horizontal scroll instead of vertical???

    thanks in advance.

    tom

  27. Jaemi K says:

    Awesome write-up! I totally want to give it a whirl. But I think I have some viewers who may be both IE users and script-disabled :/

    • dawn says:

      Did you add the script in the tutorial for “Backwards Compatibility”? It gets all versions of Internet Explorer, including 8, to style elements it doesn’t recognize. Just included the following code:

      (I just copied and pasted this from this tutorial, good luck)

      • Michael says:

        What Jaemi K is saying is that those IE users have script disabled, therefore the compatibility script is useless to them.
        I have to say i came to this article hoping to find it full of information about backwards compatibility, but was disappointed to find one line dedicated to the subject; even more disappointed to find out it depends on a script hosted by Google.
        Let me finish this with saying I think this is a good article overall (though the title may be mislead), and I respect your work.

  28. Ant Gray says:

    I like one-paged sites, why so few people make them?

  29. Hi Tom,

    First of all, I would like to thank you for this information which is really useful to all the person who would be bound to work in near future.

    You described the whole things in very systematic manner, I became fan of you.

    Hoping so to get more information on this topics (Html5 & Css3) in near future.

    All the very Best,
    Jeetendra

  30. Markus says:

    Hi,

    great design!
    BUT it doesn’t work in IE 8.0.
    It doesn’t load the font and doesn’t make round corners in the “headercontainer”.

    Can somebody help me?

    All the best!

  31. Ant Gray says:

    Navigation has a bug: when you press «go back on history» key, it moves to wrong section.

  32. Ajas says:

    Thanks For sharing this greate information…

  33. Richard says:

    Your SmoothScroll isn’t Opera friendly… recommend looking at KSwedberg’s version… fixes the bug.

  34. Jacob Timm says:

    I’m also interested in ideas for how to get the header section to stick at the top of the page when using ipad or iphone.

    Looks great on the desktop, but would be nice to get the same result on a mobile device.

    Thanks.

  35. Birdy says:

    Very useful tutorial. Thanks!

  36. Tony says:

    Senor Kenny…you’re brilliant.

  37. Leo says:

    Great Article and tutorial. Thank you for your wonderful work. :)

  38. dawn says:

    Thank you, Kenny. This is a great tutorial by a great teacher!

  39. Tim says:

    This was so helpful!
    I used it as a guide to design my one page portfolio!
    http://creativeglofish.com

    Thanks
    Tim

  40. AShok Malhi says:

    Great Work Bro Thanks

  41. Sven says:

    Hi Tom,

    first of all thanks for such a great tutorial!
    I used the design for my blog/portfolio page, with few minor additions and modifications. Check it out at: http://sven.webiny.com/
    There are still few bugs that I need to work out, but in general it looks good ;)
    I also put a back-link in to footer to your original page.

  42. Rob says:

    Hi,

    Just thought you should know.. I checked this page for validation…

    http://validator.w3.org/check?uri=http%3A%2F%2Finspectelement.com%2Ftutorials%2Fcode-a-backwards-compatible-one-page-portfolio-with-html5-and-css3%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.1

    You have some tags( obsolete xfn- for html5), and also some iframe stuff going on. Have you heard of RDFa, and Microdata? The semantic web is all about xml. So Html5 is really an extension of XHTML Modular.

    Just thought I would say something.

    The HTML5 syntax is subject to change. Wouldn’t you rather deal with this stuff when the WHATWG, and the creators of it are finished? That’s why they call it a working draft. They are clearly not done yet.,

  43. dreamincolor says:

    Very good ideas there!
    Don’t forget to include this great Single-Page Portfolio http://www.dreamincoloronline.com/design-code-cool-single-page-portfolio-part2/

  44. Prijedor says:

    Thanks for an interesting article.
    Your website looks good. There is one thing that does not follow the style, the error page. That page looks a bit odd.

  45. Richard Nash says:

    I’m super new to site design, and I’m trying to figure out how to make the navbar stay on top of the page when you scroll, like in your example. I like the idea that no matter where someone is on the page they can still navigate to a different page/section. How is that done? Does it work with multiple pages? Or just one page? I’ve seen it done before, but can’t figure it out on my own, even from the HTML and CSS. I apologize if my question is simple.

    RN

  46. Daniel says:

    I peed my pants seeing this demo. I’ve been struggling with making HTML5/CSS3 backwards compatible, to the point that I was looking up ways to make an angry punt code to make for users of IE to an html page telling them to get Chrome or Safari. >.<

    Thanks for the tutorial! May your loins be blessed with perpetual virility and your bank accounts will lots of digits in the black. <3

  47. DONALD Kossick says:

    need back words conpatilibily please help

  48. John says:

    Hi, i’m new to this and just wanted to know how can i define my email so that people can fill in the contact form and send it to me?
    Thanks.

  49. Kelvin says:

    CSS3Pie is good script to fix Backwards Compatible on CSS3. It works with IE6, IE7, IE8

  50. Ben Greeen says:

    Great demo, works really well and looks good too, in all browsers, except for a couple of glitches in Opera. When manually scrolling the header jumps up and down like crazy and when clicking links internal to the page, it always jumps straight to the top first before scrolling down.

    Any ideas how to fix this?

  51. Infopitcher says:

    Nice article!! i like the way u explained!!!

  52. Toure says:

    Hello, I am gonna used this as a template base for any of my onepage design. However, can anyone guide me on how to make this a HTML5 theme for wordpress?

  53. Ralph says:

    Your article is helpful for me. I will test it for some webprojects later.

  54. Minh Nguyen says:

    It’s really really helpful man! That’s awesome! Thank you!

  55. Nice tutorial, thanks for the share.

  56. Magnus says:

    Thanks for a great tutorial!

    Anyone know how I can remove the “logo” box without messing up the entire top bar?

  57. Renato says:

    Nice tutorial, thanks

  58. dekorasyon says:

    HTML5 is really excellent

  59. GT Fumetti says:

    I think a lot of the people are missing the point of this article.
    I have seen a lot of comments about it won’t work with this browser or that browser, this part looks different with that browser and so on. 1 of the first things article mentioned was that a website does not have to look identical in all browsers. Those comments about no rounded corners in ie for example are totally moot. Not all browsers are created equal, and designing to the lowest common element is a detriment to all web sites. We need to accept the fact that people who want a better experience will have a better browser.

  60. Akash says:

    Nice Tutorial :) keep Posting .

  61. Brandon says:

    How can I add a background image or color to the contentcontainer? I would like the main body background image dark but the content container white. Seems like the float:none is messing something up.

  62. daus says:

    thanks for the tutorial, now i try it to make this theme on blogger platform :)

  63. ramesh says:

    very useful this tutorial thanks a lot

  64. earl says:

    hey, i wonder which part of the css will i have to tweak so that i could change the look of the pop up message that says “you need to fill out this form”?

    thanks!

    PS you’re awesome.

  65. Rakesh says:

    Hi

    this is a great tutorial and i liked a lot., if you don’t mind can I use this template for my personal webpage… i will place a link@the footer pointed to inspect element.

    Thanks

  66. Maggie says:

    Great tutorial. I am using the basic idea for my portfolio page, but I have not been able to find a way to make the contact form work. I’m new to HTML5 and I’m not sure if I need to convert the entire HTML page to php. Can you explain how to make the contact form work?

  67. mindxstudio says:

    The best thing I found on web, I will study the code and learn more for future, thanks for sharing.

  68. Ujwal says:

    Hi Tom Kenny,

    This template doesn’t seem to be working with Blogger. I copied the HTML template above and pasted it in the Blogger HTML editor, each time I try to save the template it shows an error message: Open quote is expected for attribute “{1}” associated with an element type “id”. How to fix this? Does this template support Blogger?

  69. bisot says:

    not just like the tutorial, i use this design at http://bisot.jhtc.info/ thanks

  70. Thanxx for the tutorial can i share it on my website http://www.sharemca.com ?

  71. Hi Tom, once I read the tutorial I know I had to learn more css3 and html5 stuff, so thanks for the nice post. I have even made a somewhat copy of my portfolio but with your design implemented.
    you can check it at rafaeljohn.com/html5 , I actually treat it as my html5/css3 gallery ^_^, I’m also planning to make my porfolio gallery to be jquery slider or you know the one’s that pop out.hehe, But I guess I have to research on more resources for that *or maybe I’ll just have to dig in your site more and maybe found some good resource*.

    one question, does the form in this design works? I mean if I just actually copy the code for the form,edit some email address, it’ll work? Sadly my host has no smtp service..Thanks!

    any tips? ^^

  72. Hi Tom Kenny,

    This template doesn’t seem to be working with Blogger. I copied the HTML template above and pasted it in the Blogger HTML editor, each time I try to save the template it shows an error message: Open quote is expected for attribute “{1}” associated with an element type “id”. How to fix this? Does this template support Blogger?

  73. Zap! Media says:

    More and more websites are now making use of HTML5. Fantastic article, thanks for sharing.

  74. Mena says:

    how to change the nav bar background after jumping intro diffrent section ? or change the background-image ?

  75. Good tutorial to get you started on HTML5!

  76. Rasha says:

    Great Article , is there anyway to make slide horizontal ????
    Thanks

Become Part of the Discussion

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.