我遇到了一個問題,我的導航欄中的下拉菜單在桌面上工作,但不會在移動設備上展開。Bootstrap navbar下拉菜單不能在移動設備上工作
這裏是現場直播:http://launchsummer.org/
如果縮小頁面,移動,大小,你會看到「推出夏季」下拉列表不展開。
下面是導航欄的代碼:
<!-- Navigation -->
<!-- Note: navbar-default and navbar-inverse are both supported with this theme. -->
<nav class="navbar navbar-inverse navbar-fixed-top navbar-expanded">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="[[~1]]">
<img src="assets/[email protected]" class="img-responsive" alt="">
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="hidden">
<a href="#page-top"></a>
</li>
<li>
<a href="[[~1]]">Home</a>
</li>
<li>
<a href="[[~3]]">About Us</a>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Launch Summer <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="[[~4]]"><font color="#080A21">Program Details</font></a></li>
<li><a href="[[~5]]"><font color="#080A21">FAQ</font></a></li>
<li><a href="[[~6]]"><font color="#080A21">Launch Alumni</font></a></li>
<li><a href="[[~2]]"><font color="#080A21">Past Companies</font></a></li>
<li role="separator" class="divider"></li>
<li><a href="https://launch.fluidreview.com/" target="_blank"><font color="#080A21">Apply!</font></a></li>
</ul>
</li>
<li>
<a href="https://www.edx.org/course/becoming-entrepreneur-mitx-launch-x" target="_blank">LaunchX</a>
</li>
<li>
<a href="http://www.mitlaunchclubs.com" target="_blank">Launch Clubs</a>
</li>
<li>
<a href="https://launchsummer.wordpress.com/" target="_blank">Blog</a>
</li>
</ul>
</div>
</div>
<!-- /.navbar-collapse -->
<!-- /.container -->
</nav>
完美!謝謝。現在我只需要改變文字顏色,這樣就可以在背景中看到它,我很樂意去做 - 如何在不改變桌面視圖的文本顏色的情況下做到這一點? – Sam
我看到你用'常見問題'改變顏色。你不會的。最好使用CSS。你應該用CSS做這樣的事情: '@media(min-width:768px){ .navbar-collapse ul li .dropdown a { color:#080A21; } }' – Garric15
明白了。謝謝! – Sam