I am working on a navbar and I want the entire li element to be clickable rather than just the text in it. Currently it's structured very standardly:
<ul>
<li><a>link 1</a></li>
<li><a>link 2</a></li>
</ul>
With styling, when you hover over li the background changes, but you can only click on the text which is in the a element. What I would like to do is change the code to look like this:
<ul>
<a><span>link 1</span></a>
<a><span>link 2</span></a>
</ul>
It works perfectly, there are no major changes minus the fact that now as soon as you hover over what would've been the li element, it is all clickable as is a normal a element. My question is is this proper practice? Should I be doing this for my future projects if need be or should I maintain using <ul><li></li></ul>
format for navbars, for example, to maintain some sort of proper html coding etiquette?