A Kaidez Article

HTML5 Project: WIREFRAME SERIES #1 – HOME PAGE

TOPIC: The HTML5 Project

Read the entire “Wirefame Series”
Intro»  Page 1»  Page 2»  Page 3»

This is the first in a series of articles reviewing the wireframes for my HTML5 project, which is designing my web design & development online portfolio using pure HTML5 (see the article announcing the series). This was the toughest page to lay out: I had multiple page elements that needed to be positioned exactly to the current HTML5 specification, which will now be referred to as the spec.

(Important: I’ll be sending the final site to HTML5 Doctor and/or HTML5 Gallery for review when it’s done. While I’m confident that my site conforms to the HTML5 specification, these guys may say it doesn’t. Please keep that in mind when reading this.)

This article is structured as follows:

Wireframe Review

First, let’s look at the home page:

Home Page for kaidez portfolio site

Now, let’s break it all down…

Navigation

 

There are three navigation elements, each appearing on every page of the site:

The <header> & <footer> Tags

You guessed it right. <header> should go at the very top of the page and contain header content…

Header snippet for the kaidez portfolio site
while <footer> should go at the very bottom of the page and contain footer content.

Footer Snippet for kaidez portfolio site

The <article> & <section> Tags

Almost all unique page content goes into either one or both of these tags, making them the two most exciting and most confusing aspects of HTML5 in terms of how the spec tells us to use them.

First, let’s see what what HTML5 Doctor has to say about this:


There’s been a lot of confusion over the difference (or perceived lack of a difference) between the <article> and <section> elements in HTML5. The <article> element is a specialised kind of <section>; it has a more specific semantic meaning than <section> in that it is an independent, self-contained block of related content. We could use <section>, but using <article> gives more semantic meaning to the content.

By contrast <section> is only a block of related content, and <div> is only a block of content…To decide which of these three elements is appropriate, choose the first suitable option:

  • Would the content would make sense on its own in a feed reader? If so use <article>
  • Is the content related? If so use <section>
  • Finally if there’s no semantic relationship use <div>

Read the whole article (no pun intended) »

 
 

So…

I want to display four different samples of my work on the home page. Since I believe all my work is related on some level, I’m putting all of it into a <section> tag.

I think each sample would make sense on its own in a feed reader if needed, so I’m putting each one in their own individual <article> tag.

Section screenshot of the kaidez home page

HTML5 Doctor may shoot this down when the time comes, but I think I did this right.

The <div> Tag

The two organizations overseeing the creation of the HTML5 spec, W3C and WHATWG, want you to use the <div> tag as little as possible and, instead, use one of the newer tags. But they’re fine with you using <div> if it’s your only option.

With the social networking and blog links I discussed above, <div> was my only option. Let’s look at some other <div> tags on the home page:

  • The Container <div>

    Container Div for kaidez portfolio site

    • It’s common practice to wrap every single solitary page element into a single <div> tag, usually with an ID of either “container” or “wrapper” (I used “container”). This has not changed…you should always do this for an HTML5 page.
  • The Page Content <div>

    Entire Mid-section Home Page for the kaidez portfolio site

    • I used this to neatly contain both the <section> tag that contains all my work and another <div> tag with an ID called called “feeds”.

      Why is the “feeds” content in a <div> instead of <section> or <article>? Let’s talk about it…
  • The Feeds <div>
    Feed screenshot for kaidez portfolio site

    • I’d want to display RSS feeds of my most recent, Facebook, Twitter and blog posts on the home page and I want them above the fold. I guess I could put them in either an <article> or <section> tag, but let’s go back and review what HTML5 Doctor told us earlier:

       
      • Would the content would make sense on its own in a feed reader? If so use <article>
      • Is the content related? If so use <section>
      • Finally if there’s no semantic relationship use <div>
       

      So…

      • These Facebook, Twitter and blog posts are already in a feed. Having them stand alone in another feed seems repetitive to me so I think this cancels out #1.
      • The content being displayed here are snippets from my blog and the social networking world. I don’t think they’re really related so I think this cancels out #2.
      • With #1 and #2 canceled out, I’m going with #3.

The <small> Tag

In terms of how this tag renders text, there’s nothing new here. But in terms of how to use it as per the spec, there’s a difference.

The <small> tag does exactly as it implies: it makes text smaller. In HTML 4.01, you could use it whenever and wherever you wanted.

But according to the spec, <small> should only appear in an HTML5 page if it’s applied to small print…things like legal disclaimers and, in this case, copyrights.

Summary

As you can see, HTML5 is very big on semantics. The spec has many rules, regulations and best practices to follow when it comes to setting up the page tags. HTML5 Doctor does a great job of taking the somewhat verbose HTML5 spec and translating it into easy-to-understand terms, so they should be your first stop in understanding HTML5 as a whole.

A major major characteristic of HTML5 has to do with how all the page content relates to one another. I briefly discussed this in the <article> and <section> paragraphs above, but the <aside> tag plays a big role here as well. This will be discussed in my next article (again, no pun intended).

Read the entire “Wirefame Series”: Intro» | Page 1» | Page 2» | Page 3»

 
 
 

3 Responses to HTML5 Project: WIREFRAME SERIES #1 – HOME PAGE

  1. Allan HansonNo Gravatar says:

    I am having trouble with the article tag . The problem is netting them in side the section tag ! What i am trying to do is get three articles to go across the page as three columns. Thus the lay out would look like four nested tags — one going across the page and the remaining three as columns —- with the [footer] at the bottom.

    AlHanson

  2. kaidezNo Gravatar says:

    Hey Al. Thanks for stopping by!

    Just so I’m clear: Are you having trouble positioning the four nested article tags inside one single section tag with CSS?

    Also, just so I’m clear: should the footer tag be placed in the section tag as well?

  3. kaidezNo Gravatar says:

    Hey Al. I wasn’t sure what you needed, so I whipped up some quick-and-dirty CSS for the layout of my Home page wireframe:


    <!DOCTYPE html>
    <html dir="ltr" lang="en-US">
    <head>
    <meta charset="UTF-8" />
    <title>HTML5 Article Positioning With CSS</title>
    <style>
    /*
    If the browser is not HTML5-compliant, display all
    HTML5 tags as block elements so the tags display neatly
    */
    article, aside, footer, header, hgroup, nav, section {
    display: block;
    }
    section {
    width:500px;
    padding:10px;
    border:1px solid blue;
    text-align:center;
    margin:0px auto;
    height:360px;
    }
    #top {
    background-color:Red;
    width:500px;
    height:100px;
    clear:both;
    margin-bottom:10px;
    }
    .column {
    float:left;
    height:250px;
    width:160px;
    background-color:Green;
    }
    #one {
    margin-right:10px;
    background: #c0f;
    }
    #two {
    margin-right:10px;
    background: #0f6;
    }
    #three {
    background: #ff3;
    }
    </style>
    </head>
    <body>
    <section>
    <article id="top">Top Article</article>
    <article class="column" id="one">Article Column #1</article>
    <article class="column" id="two">Article Column #2</article>
    <article class="column" id="three">Article Column #3</article>
    </section>
    </body>
    </html>

    Of course, you’ll need to review this code in an HTML5-capable browser. And if you want this code to run in a non-HTML5-capable browser, you’ll need to include something like Modernizr to keep things neat.

    The key thing to remember here is that all of my article tags on my Home page are related to one another, so they can all go inside the same section tag.

    If you wanted a footer tag to go into a section tag (and I may have misunderstood your comment about this), there should be a header tag in there as well.

    The truth is, there are a lot of ways that you can do arrange sections and articles…this is why, IMHO, the whole HTML5 article/section thing can be so confusing at times.

    While I was structuring articles and sections in these wireframes, this quote from HTML5 Doctor was my mantra:

    * Would the content would make sense on its own in a feed reader? If so use [article]
    * Is the content related? If so use [section]
    * Finally if there’s no semantic relationship use [div]

    The source for both this answer and the reasoning behind my laying out the sections and articles as I did can be found within this article at HTML5 Doctor.

    Hope this helps!
    -k

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">