HTML5: Wrap Block-Level Elements with anchor tags
Posted July 27th, 2010 in HTML and CSS and Offsite Articles
David Walsh posted "HTML5: Wrap Block-Level Elements with A’s" which looks at a new feature in HTML5 which allows anchor tags to contain block level elements such as divs. This saves having to put many additional <a> tags within elements to make them all contain the same link, or do workarounds with Javascript.
From the article
HTML5 presents a simpler line of thought with HTML than XHTML. And quite honestly, it’s a much needed simplification. One of those simplifications is the ability to wrap block-level elements like DIVs, H-tags, and P’s with basic A elements. You read that correctly: wrap block-level elements with A tags. Read more
My comments
What's quite interesting about now being able to do this, is that it's been taboo for such a long time so it just doesn't quite feel right. However I'll certainly be embracing it because it will make coding HTML and links so much easier!
Related posts:
- HTML5: Valid characters for the ID attribute (Monday, August 2nd 2010)
- HTML5 Tips, Tricks and Techniques (Wednesday, July 28th 2010)
- Required attributes for HTML5 image input (Saturday, March 20th 2010)
- Add an icon before or after a link with CSS (Saturday, February 6th 2010)
- Getting ready for HTML 5 (Saturday, December 12th 2009)
- Prevent dotted border from appearing when clicking links in Firefox (Saturday, September 12th 2009)
Share or Bookmark
Share or Bookmark this page using the following services. You will need to have an account with the selected service in order to post links or bookmark this page.
Subscribe or Follow
Subscribe via RSS or email, or follow me on Facebook or Twitter below. The RSS icon takes you through to Feedburner where you can select the service or application to use.
