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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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 ofdisplay:blockA clickable <li> using an <a> tag – no JS to be used. Is it legal HTML?