我正在尝试使设计网站使用angular。现在的问题是,如果我将折叠导航栏固定在顶部,则导航栏为全宽,但它与页面重叠。否则,导航栏仅覆盖内容区域。
不带固定顶盖: enter image description here
<nav class="navbar navbar-expand-md bg-dark navbar-dark justify-content- center ">
<button type="button" class="navbar-toggler" data-toggle="collapse" (click) ="toggler()">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" [ngClass]="{'show': isOpen}">
<img src="assets/image/coding.png" alt="coding" height="34px" width="34px" class="brand-image">
<span class="navbar-text">Jamilur Rahman</span>
<ul class="navbar-nav ">
<li class="nav-item" routerLinkActive="active current">
<a class="nav-link" routerLink="">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Work</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</nav>
答案 0 :(得分:0)