相关疑难解决方法(0)

如何通过单击<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>
Run Code Online (Sandbox Code Playgroud)

<li>有点大,左边有一个小图像,我必须实际点击它<a>来激活链接.如何点击<li>激活链接?

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;
}
Run Code Online (Sandbox Code Playgroud)

html css anchor menu html-lists

61
推荐指数
5
解决办法
26万
查看次数

在jQuery Mobile中启用列表项到可单击区域

描述: 以下代码片段在Android/iPhone中用于Roundabout carousal.每个LI 100px x 100px的宽度和高度.并且链接是LI的顶部.

  <div data-role="content" data-theme="aa">
    <ul class="roundabout-holder"> 
         <li class="roundabout-moveable-item">
             <a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li> 
         <li class="roundabout-moveable-item"> 
             <a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li> 
         <li class="roundabout-moveable-item"> 
             <a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li> 
         <li class="roundabout-moveable-item"> 
             <a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li> 
         <li class="roundabout-moveable-item"> 
             <a href="<%= url_for :action => :graph %>"> <%= label_for:link %></a></li> 
    </ul> 
  </div>
Run Code Online (Sandbox Code Playgroud)

CSS

.roundabout-holder {
    list-style: none;
    width: …
Run Code Online (Sandbox Code Playgroud)

css jquery jquery-mobile

6
推荐指数
1
解决办法
2254
查看次数

标签 统计

css ×2

anchor ×1

html ×1

html-lists ×1

jquery ×1

jquery-mobile ×1

menu ×1