Jump to content

new html5 tags vs divs


funbinod

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 comment
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 comment
Share on other sites

I still have the 'habit' I guess we can call it of using div's with id's, would it be recommended to switch over to using the HTML5 tags for the sake of SEO, screen readers, future technologies? Thanks.

Link to comment
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 comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...