Reputation: 19
I have a markup like which i have given below : I have given some link to the anchor tag but I want user to click anywhere on the li tag to make link redirect to link given to anchor tag but i cannot place my span inside the anchor tag ,it has to be outside of the anchor tag.what will be the css for that and it should work in IE also.
<ul>
<li>
<span> 1 </span>
<a href="">Click any where in the li i will take u to somewhere</a>
</li>
</ul>
Upvotes: 0
Views: 332
Reputation: 1513
You can't modify the document object model with css. You would need a javascript function for that.
Upvotes: 1
Reputation: 42480
You could try something like:
<li onlick="window.location.href='your.url'"> ... </li>
Upvotes: 0