Welcome to WebmasterWorld Guest from 54.145.13.215

Forum Moderators: incrediBILL

Message Too Old, No Replies

html5 new tags question

html5 tag

     
5:03 am on May 12, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:May 21, 2004
posts: 374
votes: 4


Working on a new site design and will be using html5 instead of xhtml strict this time around. Not much different actually, but I did have a question that maybe someone can answer...

<nav><nav> as an example... I have found that eventhough I have stated these new tags in my css and blocks that older browsers will not show any stylization for them. As an example, I stylizied my nav the other day and the only way to get it to work properly was to use <nav><div> where my div was the actual stylization.

So, I guess what I am asking is do these new tags such as header, nav, article, etc operate in the way I would expect them too - everything contained within them?

Related question is I have read that nav should be used for the main navigation of the page and not every single group of links...aside would be best used for something like a sidebar (relevant links and info to the page content), and article should be the actual main content of the page (such as product details/description) if a product page. Section on the other hand sounds like it would never really be used... does this all sounds about right? I have a feeling these are going to be used down the road by engines so I figure might as well get the layouts done right to begin with.
6:42 am on May 14, 2012 (gmt 0)

New User

joined:May 13, 2012
posts:20
votes: 0


Hi
I add ID attribute in <section>, <nav>, ..., then in css i reffer to that id.
Also adding in css:
header, footer, section, aside, nav, article {display: block;}

I think is better to have less tags in the code, without <div> in <nav>:

<nav id="menu">
<ul>
<li>...</li>
<li>...</li>
</ul>
</nav>
1:45 pm on May 14, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4966
votes: 10



older browsers will not show any stylization for them

That's what [modernizr.com...] is for. :)
11:45 am on May 19, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 29, 2002
posts:980
votes: 0


As Fotiman says, you can use Modernizr to get old IE to recognise the new HTML5 sectioning elements. Modernizr includes the HTML5 Shiv, which you can read more about here:

[paulirish.com...]
3:42 am on June 14, 2012 (gmt 0)

New User

joined:June 14, 2012
posts: 4
votes: 0


Related question is I have read that nav should be used for the main navigation of the page and not every single group of links...aside would be best used for something like a sidebar (relevant links and info to the page content), and article should be the actual main content of the page (such as product details/description) if a product page.
4:10 am on June 14, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


Something many people don't realize, many of the new HTML5 tags came from research that Google did, noting what class and ID names were being commonly used by web authors. The idea is to standardize a lot of that mark-up and thereby simplify the source code, and yes -- make it communicate in a clearer fashion to anyone who works on the code.