HTML5: is div dead? Not, really...
I must admit I am not a great fan of HTML5. First I've tried to understand the new tags and then I've started using them on new projects, sometimes ago. I even contacted the Doctors on HTML5 Doctor to submit some questions and prepare an interview to be published on the web thought. They were obviously too busy and, even if they initially agreed on the interview, they've never got back to me with the answers.
Anyway, in this short post I will try to explain where the new content formatting tags should be used and how they can replace the div tag... if ever.
As you can see, following the above schema, every tag has its specific purpose.
In any case, we should remember that even if a tag is named "article", that doesn't mean we have to use it only when strictly dealing with articles.
Let's see every single tag...
The header is a place where we show general information, possibly repeated on every page. It can contain the company logo, for example.
The nav section should contain the web site navigation, such as a menu.
It's not just articles, in strict sense. This section is where we insert the web site content.
If articles or, generally speaking, content can be divided into sub parts, is the place where to put those parts. It's clear that we can end up having more than one section.
This tag can be used to insert other content not strictly related to the "main" content. For example, it can contain ads, images or other external links.
The footer is normally staying at the bottom of a web page and contains - again like the header - information that we usually repeat on every page.
As a side note: footer and header are not to be considered only related to the page or the web site. They can be used as header or footer of an article as well. We then can have more than one footer or header.
Anyway, in this short post I will try to explain where the new content formatting tags should be used and how they can replace the div tag... if ever.
A page structure
First of all let me show you how we can use the new tags in a page:As you can see, following the above schema, every tag has its specific purpose.
In any case, we should remember that even if a tag is named "article", that doesn't mean we have to use it only when strictly dealing with articles.
Let's see every single tag...
The header is a place where we show general information, possibly repeated on every page. It can contain the company logo, for example.
The nav section should contain the web site navigation, such as a menu.
It's not just articles, in strict sense. This section is where we insert the web site content.
If articles or, generally speaking, content can be divided into sub parts,
This tag can be used to insert other content not strictly related to the "main" content. For example, it can contain ads, images or other external links.
The footer is normally staying at the bottom of a web page and contains - again like the header - information that we usually repeat on every page.
As a side note: footer and header are not to be considered only related to the page or the web site. They can be used as header or footer of an article as well. We then can have more than one footer or header.
What about the div?
As you can see, many of the above tags can replace the div. When we develop web sites, we are used to create containers with divs: for example, a navigation menu is usually contained in a div. Now, we should use