I always want to ask this question:
Is this validate
<a><li></li></a>
Or should always have
<li><a></a></li>
Is the first way wrong or you are allow to do that?
the first one is wrong, as only <li>
is to be a child of a list. the second is correct.
by what i understand, you want the whole list item to be "clickable". putting everything in <a>
is also viable - block AND inline elements. this is perfectly valid in HTML5. won't validate in older HTML though. however, it does act correctly, given that <a>
is given the style of display:block
A clickable <li> using an <a> tag - no JS to be used. Is it legal HTML?