我正在搞乱引导程序,只是试图了解一些基本功能。我搞乱了导航栏,并设法让我的导航栏固定在我的页面顶部,但当我全屏显示我的窗口时,我再也看不到导航栏中的链接了。我只能看到下拉按钮。我正在关注bootstrap网页本身的所有信息。谁知道为什么?
https://v4-alpha.getbootstrap.com/components/navbar/
var test="Hello";
答案 0 :(得分:2)
Bootstrap 4导航栏默认为移动,除非使用其中一个navbar-toggleable-*
类明确覆盖。由于导航栏中未指定任何内容,因此它始终处于折叠状态/移动状态。如果您希望它在更宽的屏幕上显示链接,请指定适当的范围,例如:navbar-toggleable-md
...
<nav class="navbar navbar-toggleable-md fixed-top navbar-light bg-faded">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Navbar</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text" placeholder="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>