我有一个bootstrap 4可折叠的导航栏,在索引页和另一个页面上工作,现在当我去另一个页面,不是这两个之一的可折叠的导航栏似乎不工作。即使它是所有的复制粘贴从索引页。
我已经尝试了不同版本的bootstrap 4,并尝试使用bootstrap的默认导航栏之一,但这些似乎也不起作用。
于飞:
<nav class="navbar bg-custom navbar-expand-lg navbar-dark">
<a class="navbar-brand" href="index"><img src="dist/img/logo_yme.png" alt="Logo" width="236"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item animated"><a class="nav-link" href="vacatures">Vacatures</a></li>
<li class="nav-item animated"><a class="nav-link" href="fotos">foto's</a></li>
<li class="nav-item animated"><a class="nav-link" href="contact">Contact</a></li>
</ul>
</div>
</nav>
head标签中的链接:
<link rel="stylesheet" href="./dist/css/main.css"/>
<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"/>
<link href="https://fonts.googleapis.com/css?family=Didact+Gothic&display=swap" rel="stylesheet">
当菜单被折叠时,我希望它能工作,但事实并非如此。我没有在控制台或任何东西中收到任何错误信息。当查看网络选项卡时,一切都在正常加载。
注意:我在我的.htaccess文件中有一些自定义路由,因此它不需要扩展名。
.htaccess中的代码:
# mod_rewrite starts here
RewriteEngine on
# does not apply to existing directories, meaning that if the folder exists on the server then don't change anything and don't run the rule!!!!!
RewriteCond %{REQUEST_FILENAME} !-d
# Check for files with .html extension
RewriteCond %{REQUEST_FILENAME}\.html -f
# Here we show the page that has the .html extension
RewriteRule ^(.*)$ $1.html [NC,L]
1条答案
按热度按时间t98cgbkg1#
**新手错误:**我忘记添加js文件-,-