Search code examples
htmlinternet-explorer-7modernizrhtml5boilerplate

HTML 5 allows to place a block element inside an anchor tag. Is there a work around to make it so IE7 also support it?


I want to dig into html5, I have used html5boilerplate which has modernizr.js I wrote following code but it seems IE7 do not support it. What is the workaround for it using modernizr so it can work in IE7? I am not very familiar with html5, html5bp and modernizr.

<a href="/somlink">
  <img src="/img/someimage.jpg" alt="some image">
  <span>Some Caption</span>
  <h1>Some Heading<span class="subtext">Inside Anchor</span></h1>
</a>

Solution

  • Based on comments above, this will work in IE7 without doing anything.

    The problem is that you are using position:absolute on the span and h1. They are still clickable, but the cursor makes it look like they are not. Just add a cursor:pointer to get round this.

    See: http://jsbin.com/ilojim/4/