最佳答案
转到 https://getbootstrap.com/getting-started/ ,您可以学习使用 Bootstrap 轻松创建导航栏等内容。
将它放在 head 部分的 html 脚本的顶部,以便 bootstrap 工作或下载 bootstrap 并将其放在您的元素文件夹中。
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
这是一个使用 bootstrap 的例子。
<!--appear when room to display is smaller-->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#top">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Your Logo</a>
</div>
<div class="collapse navbar-collapse" id="top">
<ul class="nav navbar-nav">
<li class="active">
<a href ="put your link here">
Item
</a>
</li>
<!--align content to the right-->
<ul class="nav navbar-nav navbar-right">
<li class="active">
<a href ="">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
Item
</a>
</li>
<li class="active">
<a href ="">
<span class="glyphicon glyphicon-off" aria-hidden="true"></span>
Item
</a>
</li>
</ul>
</div>
</div>
</nav>
关于具有移动支持和 Logo 的 Html 导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37784866/