开发者

W3C validating clickable content box

Is it possible to create a c开发者_如何学运维lickable box that validates (W3C)? In the clickable box I need list elements and paragraphs.

This don't validate:

<a href="http://www.test.com">
   <p>My paragraph</p>
   <ul>
      <li>My content item</li>
   </ul>
</a>

This validates but don't solve the problem (very ugly):

<a href="http://www.test.com">
   <span class="p">My paragraph</span>
   <span class="ul">
      <span class="li">My content item</span>
   </span>
</a>

This validates but disables the middle mouse click to open page in a new tab.

<div onclick="window.location='http://www.test.com'">
   <p>My paragraph</p>
   <ul>
      <li>My content item</li>
   </ul>
</div>


Have you tried option 1 with the HTML5 doctype: <!DOCTYPE html> - it should validate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜