小技巧:bootstrapdocs.com导航栏示例(Bootstrap 3.3)

时间:2019-02-24 04:11:37

标签: css twitter-bootstrap-3 navbar

我想知道如何使悬停而不是按显示的下拉菜单。 这是示例:

https://bootstrapdocs.com/v3.3.6/docs/examples/navbar/

我确实尝试添加:

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

没用。任何帮助将不胜感激。

谢谢

2 个答案:

答案 0 :(得分:2)

⋊> ~ conda install tensorflow                                       
12:24:09
    Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - anaconda==2018.12=py37_0 -> cython==0.29.2=py37h0a44026_0
  - anaconda==2018.12=py37_0 -> mkl-service==1.1.2=py37hfbe908c_5
  - anaconda==2018.12=py37_0 -> numexpr==2.6.8=py37h7413580_0
  - anaconda==2018.12=py37_0 -> scikit-learn==0.20.1=py37h27c97d8_0
  - tensorflow
Use "conda info <package>" to see the dependencies for each package.

可以请您尝试上述方法。

答案 1 :(得分:1)

除了接受的答案之外,还有更多的东西。如果您还想突出显示.dropdown-toggle的背景色,则需要再多行CSS

enter image description here

.navbar-default .navbar-nav > .dropdown:hover > a {
  color: #555;
  background-color: #e7e7e7;
}

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

没有这些行:

enter image description here