如何通过点击< li>?来激活HTML链接 [英] How to make the HTML link activated by clicking on the <li>?
本文介绍了如何通过点击< li>?来激活HTML链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下标记
<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>
< li>
大,左边有一个小图片
我必须点击< a>
来激活链接。
如何点击< li>
激活链接?
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;
}
推荐答案
#menu li { padding: 0px; }
#menu li a { margin: 0px; display: block; width: 100%; height: 100%; }
它可能需要对IE6进行一些调整,但这是关于如何做。
It may need some tweaking for IE6, but that's about how you do it.
这篇关于如何通过点击< li>?来激活HTML链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文