html - Could i use <a> in <ul> around <li> -


ive got 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 perfektly fine in major browsers, isnt allowed/invalid html , right way should this:

<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 second example text not whole <li> clickable want to.
should stay invalid working version or has better solution?

use css make link take entire list item, eg. display: block (and other styling might want).

wrapping links around list items invalid html.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -