Jump to content

new html5 tags vs divs


Recommended Posts

I wonder what exactly is difference between some new html5 tags and divs with ids

 

like-----

<header> </header><section> </section><aside> </aside><footer> </footer>

and

<div id="header"> </div><div id="section"> </div><div id="aside"> </div><div id="footer"> </div>
Link to post
Share on other sites

They're there so that future technology can understand what's contained in them. For example, a search engine might choose to ignore content in the topmost header and footer elements when indexing content from a particular page so that the search result more accurately reflects the page itself.

 

IDs can't be used like this because there's no standardized convention for which ID means what.

Link to post
Share on other sites

Yes, you should begin using the new semantic HTML elements. For Internet Explorer 8 and under to style them properly you'll need what's called a "shiv". What it does is call document.createElement() for each of the kinds of elements that Internet Explorer doesn't understand and then gives default styles for them.

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...