twitter-bootstrap 鼠标指针悬停在 Twitter Bootstrap 下拉导航上

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19479527/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 18:54:58  来源:igfitidea点击:

Mouse pointer on hover of Twitter Bootstrap dropdown nav

twitter-bootstrap

提问by Cristiano

When I hover over the dropdown in my navbar, the mouse changes to the text pointer instead of the hand pointer that should show for a link.

当我将鼠标悬停在导航栏中的下拉菜单上时,鼠标会变为文本指针,而不是应该显示链接的手形指针。

Here's my html:

这是我的 html:

<ul class="nav">
  <li class="active"><%= link_to 'Home', root_path %></li>
  <li><a href="#">Forums</a></li>
  <li class="dropdown">
    <a data-target="#" class="dropdown-toggle" data-toggle="dropdown" role="button">
      World vs. World
      <b class="caret"></b>
    </a>
    <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
      <li><%= link_to 'Current Match', current_match_path %></li>
      <li><%= link_to 'All NA Matches', wvw_path %></li>
    </ul>
  </li>
</ul>

Anybody know how I can fix this?

有谁知道我该如何解决这个问题?

回答by zessx

We're missing your CSS, but I would go for a simple cursor: pointer:

我们缺少您的 CSS,但我会选择一个简单的cursor: pointer

.dropdown-menu li:hover {
    cursor: pointer;
}

回答by waldyrious

An alternative to cursor:pointeris adding an inert hrefattribute for the <a>, e.g. href="#"(although some object to this).

一种替代方法cursor:pointerhref<a>,例如href="#"(尽管某些对象添加到 this)的惰性属性。

回答by Kaushik

for bootstrap 4

用于引导程序 4

.dropdown:hover .dropdown-menu {display: block;}

.dropdown:hover .dropdown-menu {display: block;}