我做了一个下拉按钮,当我分别打开 navbar 页面时,该按钮显示了一个列表。但是,当我将此 navbar 页面与另一页面一起包含
时,屏幕上不会显示下拉列表这是我打开此标题页时的输出
当我将此导航栏页面与其他页面下拉列表合并时,不显示
.brandlogo {
text-transform: uppercase;
color: white;
font-size: 25px;
font-weight: bold;
padding-left: 10px;
}
.menulines {
color: white;
cursor: pointer;
font-size: 25px;
}
.adminbtn {
height: 30px;
margin-top: 40px;
margin-right: 2px;
line-height: 15px;
position: absolute;
}
.dropdown-menu a {
line-height: 30px;
font-size: 12px;
position: relative;
display: block;
}
<header style="position: sticky;top: 0;width: 100%">
<div class="topheadadmin">
<div class="brandlogo">
<span class="menulines" onclick="opennav()">☰</span>
<a href="adminpanel.php" style="list-style: none;text-decoration: none;color: white">Admin Panel</a>
</div>
<div class="btn-group">
<a href="#" class="btn btn-danger dropdown-toggle adminbtn" aria-expanded="true" role="button" data-toggle="dropdown">Admin</a>
<div class="dropdown-menu dropdown-menu-right">
<a href="" class="dropdown-item"><span class="fa fa-lock"></span> profile</a>
<a href="" class="dropdown-item"><span class="fa fa-lock"></span> Change Password</a>
<div class="dropdown-divider"></div>
<a href="" class="dropdown-item"><span class="fa fa-power-off"></span> Logout</a>
</div>
</div>
</div>
</header>