html - 当前课堂主题
问题描述
导航上的当前课程不起作用。你能帮我弄清楚为什么吗?我试图只使用类,或带有链接的类,或任何组合,但它不起作用。
\\\
Here's the HTML part related to nav:
<nav class="secondary_header">
<ul>
<li><a class="current" href="about.html"> ABOUT</a></li>
<li><a href="experience.html">EXPERIENCE</a></li>
<li><a href="knowledge.html">KNOWLEDGE</a></li>
<li><a href="goals.html">GOALS</a></li>
<li><a href="humor.html">HUMOR</a></li>
</ul>
</nav>
\\\
This is the CSS part:
\\\
.secondary_header {
width: 100%;
padding-top: 20px;
padding-bottom: 20px;
background-color: #d3d3d3;
clear: left;
}
.secondary_header ul {
margin-top: 0%;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 15px;
padding-left: 0px;
width: 100%;
}
.secondary_header ul li a {
list-style: none;
text-decoration: none;
float: left;
margin-right: auto;
margin-top: 0px;
font-family: 'Montserrat', sans-serif;
font-weight: bold;
font-size: 15px;
color: #FFFFFF;
letter-spacing: 1px;
margin-left: auto;
text-align: center;
width: 20%;
transition: all 0.3s linear;
}
.secondary_header ul li:hover a {
color: #f54242;
cursor: pointer;
}
.secondary_header ul li current.a {
color: #f54242;
cursor: pointer;
}
\\\
基本上,我希望当前状态(您所在的页面)的颜色与悬停状态相同。任何建议都非常感谢。非常感谢!
解决方案
推荐阅读
- scala - Scala:将过程代码转换为功能代码
- haskell - 用于 GHC 8.10.2 的 haskell-language-server 0.3.0 在 Windows_NT 上不可用
- c++ - 在一个线程中完成的操作对另一个线程可见,无需显式同步
- javascript - 未捕获的 ReferenceError:函数名未从导入中定义
- css - 有没有办法将父选择器($)保存为 SCSS 中的变量?
- amazon-web-services - Hibernate EC2 实例:它真的会冻结操作系统吗?
- angular - 无法在数字上创建属性“回调”-Angular 9 中的 jsPDF
- python - Python 从 4 个点创建一个椭圆
- firebase - 部署错误 Cloud Functions - Firebase 部署
- vba - 如何在 Excel VBA 中使用名为 Sub 的变量传递 Vlookup 的第一个参数