首页 > 解决方案 > 当前课堂主题

问题描述

导航上的当前课程不起作用。你能帮我弄清楚为什么吗?我试图只使用类,或带有链接的类,或任何组合,但它不起作用。

\\\

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;
}

    \\\

基本上,我希望当前状态(您所在的页面)的颜色与悬停状态相同。任何建议都非常感谢。非常感谢!

标签: htmlcss

解决方案


推荐阅读