My doctype is html5. I am validating this HTML:
<a class="article-link-block" href="http://localhost/article/231">
<img src="http://localhost/images/article-image.jpg">
<div class="article-info">
<a class="title" href="http://localhost/article/231">Title of the article</a>
<a class="category" href="http://localhost/category/5">Category</a>
<div class="views">24x</div>
<div class="date">13.3.2013</div>
</div>
</a>
I am getting this error:
Error: An a start tag seen but an element of the same type was already open.
I want the whole div
to be an anchor tag ( article-link-block ) and within it another anchor tags to category, user etc. and other divs (the code above is simplified to only article and category link.)
How can I get rid of this error during html validation?
If you want it all to validate you're going to have to choose whether you want the block level link, or the child links. You can't have both. From the spec:
Interactive content is:
So your options are:
click
events