I have the following markup,
<ul id="menu">
<li><a href="#">Something1</a></li>
<li><a href="#">Something2</a></li>
<li><a href="#">Something3</a></li>
<li><a href="#">Something4</a></li>
</ul>
The <li>
is a bit big, with a small image on its left,
I have to actually click on the <a>
to activate the link.
How can I make a click on the <li>
activate the link?
Edit1:
ul#menu li
{
display:block;
list-style: none;
background: #e8eef4 url(images/arrow.png) 2% 50% no-repeat;
border: 1px solid #b2b2b2;
padding: 0;
margin-top: 5px;
}
ul#menu li a
{
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
padding-right:.5em;
color: #696969;
}
Just to throw this option out there:
This is the style I use in my menus, it makes the list item itself a hyperlink (similar to how one would make an image a link).
For styling, I usually apply something like this:
I can then apply whatever styling to the <li> that I wish.
Note: Validators will complain about this method, but if you're like me and do not base your life around them, this should work just fine.
The following seems to work:
It may need some tweaking for IE6, but that's about how you do it.
Use jQuery so you don't have to write inline javascript on
<li>
element:This will make whole
<li>
object as a link :Just add wrap the link text in a 'p' tag or something similar and add margin and padding to that element, this way it wont affect the settings that MiffTheFox gave you, i.e.