我一直在尝试将 slicknav 菜单合并到我的学校项目中,我对编码并不完全陌生,我相信我的错误很简单,但是经过 3 个小时的绞尽脑汁,我似乎无法找到解决问题的方法,一些有关如何修复它或改进我的代码的帮助、见解或提示将不胜感激。(顺便说一句,我已经有一些功能可用的下拉菜单,但我想有一个用于移动屏幕的 slicknav
html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shape up!</title>
<link rel="shortcut icon" href="images/favicon.ico">
<!--^^^TITLE LOGO^^^-->
<link href="styles/normalize.css" rel="stylesheet" type="text/css">
<link href="styles/main_rwd.css" rel="stylesheet" type= "text/css">
<link href="styles/slicknav.css" rel="stylesheet" type="text/css">
<script src="https://code.jquery.com/jquery-3.2.1.min.js"> </script>
<script src="js/jquery.slicknav.min.js"></script>
<!-- <script href="js/jquery.slicknav.min.js"></script>-->
<script type="text/javascript">
<script>
$(function(){
$('#nav_menu').slicknav();
});
</script>
</head>
<header>
<img src="images/shape_up_logo.png" alt="Shape up logo">
<!--^^^SITE LOGO^^^-->
<h1 id="logo"><a href="/index.html">Shape Up!</a></h1>
<h3>Find the best fit for you!</h3>
</header>
<body>
<main>
<nav id="nav_menu">
<ul>
<li><a href="index.html" class="current">Home</a></li>
<li><a href="strength/index.html">Strength Training</a>
<ul>
<li></li>
</ul>
</li>
<li><a href="cardio/index.html">Cardio Exercises</a></li>
<li><a href="stress/index.html">Stress Relief</a>
<ul>
<li><a href="stress/index.html">What is Stress?</a></li>
<li><a href="stress/tips.html">5 Helpful Tips</a></li>
<li><a href="stress/meditate.html">Meditation</a></li>
<li><a href="stress/vipassana.html">Vipassana</a></li>
</ul>
</li>
<li><a href="diet/index.html">Healthy Diets</a>
<ul>
<li><a href="diet/index.html">Why a Healthy Diet?</a></li>
<li><a href="diet/meals.html">Plan Your Meals</a></li>
<li><a href="diet/calories.html">Count Your Calories</a>
</li>
<li><a href="diet/bmi.html">Calculate Your BMI</a></li>
</ul>
</li>
</ul>
</nav>
下一部分是关于 slicknav 的 css 代码
slicknav_menu {
display:none;
}
@media only screen and (max-width: 900px) {
body {
box-shadow: none;
font-size: 90%;
}
}
/*
TABLET SIZE^^^
.slicknav_menu {
display:none;
}
*/
@media only screen and (max-width: 767px) {
#nav_menu {
display: none;
}
.js .slicknav_menu {
display: block;
}
}
出于故障排除的原因,我已经评论了一些东西,任何帮助将不胜感激,因为无论如何我可能错过了一件简单的事情