HTML5 Changes to the A Element

There are a few changes to elements and new elements in HTML5. One of those elements is the a element, or anchor element. It’s used to create hyperlinks. There are a few changes to this element.

  1. The name attribute is obsolete.You can no longer use something like…

    <a name="whatever"></a><div>Some content.</div>

    Instead, put an id on the nearest container…

    <div id="whatever">Some content.</div>

  2. The target attribute has changed.This used to be deprecated, but now it’s not. Go ahead and use it.

    <a href="http://blog.strimble.com/" target="_blank">blog</a>

  3. There is a new media attribute.This is the type of media that the destination of the hyperlink was designed for.

    <a href="http://blog.strimble.com/" media="screen">blog</a>

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • FriendFeed
  • Identi.ca
  • Netvibes
  • Reddit
  • StumbleUpon
  • ThisNext
  • Tumblr
  • Twitter

Post a Comment