下拉按钮列表未显示在屏幕上

时间:2020-10-26 22:33:56

标签: html css bootstrap-4

我做了一个下拉按钮,当我分别打开 navbar 页面时,该按钮显示了一个列表。但是,当我将此 navbar 页面与另一页面一起包含

时,屏幕上不会显示下拉列表

screenshot 1 这是我打开此标题页时的输出

screenshot 2 当我将此导航栏页面与其他页面下拉列表合并时,不显示

.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()">&#9776;</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>&nbsp;profile</a>
        <a href="" class="dropdown-item"><span class="fa fa-lock"></span>&nbsp;Change Password</a>
        <div class="dropdown-divider"></div>

        <a href="" class="dropdown-item"><span class="fa fa-power-off"></span>&nbsp;Logout</a>

      </div>
    </div>
  </div>
</header>

0 个答案:

没有答案