两个链接不显示

时间:2019-07-18 11:48:27

标签: html css twitter-bootstrap

我在标题组件中键入了2个链接,但是这些链接没有显示。这很奇怪,因为一切似乎都很好。这2个链接在ul列表中。

<nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #563F7A">
    <a class="navbar-brand" href="#">Ürün Listesi</a>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav mr-auto">
        <li class="nav-item">
          <a class="nav-link" href="#">Ürün İşlemleri</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">Ürün Çıkışı</a>
        </li>
      </ul>
    </div>
  </nav

1 个答案:

答案 0 :(得分:3)

您的问题出在您的div上:

<div class="collapse navbar-collapse" id="navbarSupportedContent">

collapse类将隐藏您的div,因为它添加了样式display: none(如果未添加.show),则需要删除它以查看链接:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #563F7A">
  <a class="navbar-brand" href="#">Ürün Listesi</a>
  <div class="navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item">
        <a class="nav-link" href="#">Ürün İşlemleri</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Ürün Çıkışı</a>
      </li>
    </ul>
  </div>
</nav>