11

Possible Duplicate:
Are new HTML5 elements like <section> and <article> pointless?

I have decided to, finally, make the move to designing websites in HTML5. I have one question about the new tags.

There are new tags such as; header, footer, navbar, etc.. Why are these tags preferred over the older method of using DIV ID's (eg. <div id="header">). I can see why this would make things simpler but wouldn't it be more confusing to have some tags that use HTML5 and some tags that use the older method? I, personally, find it more logical to use all or none, rather than a mixture.

If I'm missing the point entirely please let me know.

2
  • 1
    To keep the world moving forward. Commented Jan 13, 2013 at 16:51
  • "In September 2012 the W3C proposed a plan[27] to release a stable HTML5 Recommendation by the end of 2014" - Wikipedia (en.wikipedia.org/wiki/HTML5) You aren't supposed to migrate fully yet. Commented Jan 13, 2013 at 16:53

1 Answer 1

13

It's not an either-or situation. HTML5 still has <div>s. It still has <span>s. The new tags are there to give you more expressive freedom and to standardize common elements. For instance, most pages have navigation bars, yet so far there was no standard for how those were marked up. If they're clearly marked up as <nav>, programs can start to use this information productively. Search engines can ignore or parse them and assistive technology can help the user navigate around the site.

It also makes it easier for you to work with your code. <nav> is so much easier to spot than <div class="main nav foobar baz">.

The new tags are an addition, not an entirely new set replacing the old tags.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your comment. I do realise that the new tags are not an either-or situation as you put it. I was just wondering why you would standardise some common elements and not others when it more or less appeals more to me to use ONLY div tags rather than some DIV tags and other standardised tags. If that makes sense?
No, that doesn't really make sense. :P Before you pretty much exclusively had <div> tags. So everything was a <div> tag. What's the advantage of that? Now there are some new tags for often used elements, which allow you to semantically differentiate between elements in a standardized way. I don't know why you don't see the advantage in that and would rather want to stick to <div>s? Maybe everything should be reduced to a single <tag> tag?
I guess I just find it easier to order my DIV tags in a logical naming convention. Much like you would in a programming variables (eg. Making all variables relating to a person; person-name, person-age, person-house-no, etc..). Using one popular tag on it's own and one tag that isn't so popular such as topbar instead of sidebar just makes things, as a developer, harder to find and position in the CSS file. I can see the benefits of using common element names but not until you can subsequently make your own tags yourself that are not already taken as a HTML5 element.
And that's where you're losing me. You want to differentiate between things. Specialized tags make it easier to differentiate between things. nav and section is so much more different than div#nav and div.section. And you can make up your own tags any time you want, it just won't be standardized HTML anymore. If you go make up your own tags, they mean nothing to anybody but you, which is missing the point of standardization. That's why the new tags in the standard are a great addition, better than before where much less was standardized.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.