Can I use <a> in <ul> around <li>
I got the following code:
<ul> <a href="./index.php?profile=User1"> <li>User1 : 16</li> </a> <a href="./index.php?profile=User2"> <li>User2 : 4</li> </a> </ul> This works great in all major browsers, but this is not allowed / invalid HTML, and the correct path should be as follows:
<ul> <li> <a href="./index.php?profile=User1">User1 : 16</a> </li> <li> <a href="./index.php?profile=User2">User2 : 4</a> </li> </ul> But if I do this, as in the second example, only the text is clickable, and not the entire <li> as I want.
Should I stay with an invalid working version, or does anyone have a better solution?
+7
5 answers