<div class="container-fluid border navbar-expand-lg" style="overflow:visible; background-color: #ffffff">
<a href="#" class="nameBlock"> Vamsi Krishna Pappusetti</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="list" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="nav justify-content-end" style="display: inline-flex;" id="list">
<li class="nav-item">
<a class="nav-link " href="#">About Me</a>
</li>
<li class="nav">
<a class="nav-link" href="contact.html">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="C:\Users\vpvam\BootcampClassFiles\Bootstrap-Portfolio\portfolio.html">Portfolio</a>
</li>
</ul>
</div>
//为什么我的&#34;关于我&#34; &#34;联系&#34;和&#34;投资组合&#34;当我最小化屏幕时,凝结成汉堡包菜单?我从Bootstrap复制了按钮代码。 enter image description here
答案 0 :(得分:0)
您需要指定navbar color scheme,否则切换图标将不会设置样式。
您还有其他一些不一致之处。您可能希望重新开始使用BS4示例导航栏的副本,然后重试。在开始删除容器或覆盖样式之前设置菜单项。
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<div class="container-fluid border navbar-expand-lg navbar-light" style="overflow:visible; background-color: #ffffff">
<a href="#" class="nameBlock"> Vamsi Krishna Pappusetti</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="list" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<ul class="nav justify-content-end" style="display: inline-flex;" id="list">
<li class="nav-item">
<a class="nav-link " href="#">About Me</a>
</li>
<li class="nav">
<a class="nav-link" href="contact.html">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="C:\Users\vpvam\BootcampClassFiles\Bootstrap-Portfolio\portfolio.html">Portfolio</a>
</li>
</ul>
</div>