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.
精彩评论