**已关闭。**此问题不符合Stack Overflow guidelines。目前不接受答复。
这个问题似乎不是关于在help center定义的范围内编程。
3天前关闭。
Improve this question
我的导航栏无法正常工作。我使用Bootstrap 5,并在HTML中包含了必要的CSS和JavaScript文件。然而,当我点击导航栏切换按钮时,什么也没有发生,下拉菜单也没有出现。我已经仔细检查了我的代码,它似乎与Bootstrap文档中的示例相匹配。谁能帮我找出问题的原因?
<nav class="navbar navbar-expand-xxl bg-dark navbar-dark py-3 justify-content-between justify-content-xxl-start">
<div class="container container-fluid">
<a class="navbar-brand" href="/vacancies/all">
<img class="navbar-brand" src="/brunojobs.png" class="img-fluid" alt="brunojobs logo" height="45">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/vacancies/all">Vagas</a>
</li>
<% unless company_signed_in? %>
<li class="nav-item">
<a class="nav-link" href="/companies/sign_up">Anunciar</a>
</li>
<% else %>
<li class="nav-item">
<a class="nav-link" href="/vacancies/new">Anunciar</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/vacancies">Meus Anúncios</a>
</li>
<% end %>
</ul>
<ul class="navbar-nav ms-auto">
<% if company_signed_in? %>
<li class="nav-item">
<a class="nav-link" href="/companies/edit">Meus Dados</a>
</li>
<li class="nav-item">
<%= link_to('Sair', destroy_company_session_path, method: :delete, class: 'nav-link') %>
</li>
<% else %>
<li class="nav-item">
<a class="nav-link" href="/companies/sign_in">Entrar</a>
</li>
<% end %>
</ul>
</div>
</div>
</nav>`
Vagas Anunciar Meus Anúncios Meus Dados Entrar
1条答案
按热度按时间o8x7eapl1#
试试这个代码它的工作请检查(CSS,JS)CDN配置