php - 为什么我的导航链接仍然带有下划线?即使有 !important 声明

标签 php html css wordpress

<分区>

我不确定这是否可能是由于 php/wordpress 造成的,但我有一个导航栏,当您单击该链接时它会保持下划线,直到您再次将其悬停为止?对我来说似乎很奇怪,我从来没有发生过这种情况,也不太明白为什么..

<nav>
   <ul>
      <li><a href="#"><img src=" " height="10%" width="10%"/>Link 1</a></li>

      <li><a href="#"><img src=" " height="10%" width="10%"/><a href="#">Link 2</a></li>

      <li><a href="#"><img src="" height="10%" width="10%"/><a href="#">Link 3</a></li>
   </ul>
</nav>

scss..

nav {
  margin: 0px;
  background-color: $nav_bgcolor;
  box-shadow: $nav_shadow;

   ul {
    color: #979797;
    padding: 0px;
    display: table;
    width: 100%;
    padding: 15px;
    margin: 0px;
    text-align: center;
  }
   ul li {
    list-style-type: none;
    display: inline-block;
    width: 30%;
  }
   ul li a {
    color: $font_color;
  }
   ul li a:hover {
    cursor: pointer;
    color: $hover;
  }
   a, a:visited, a:active, a:visited, a:focus, a:hover {
    text-decoration: none !important;
 }
}

最佳答案

将您的“ul li a”更改为:

nav ul li a {
color: $font_color;
text-decoration: none;
}

关于php - 为什么我的导航链接仍然带有下划线?即使有 !important 声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45703663/

上一篇:html - 选择嵌套元素而不考虑位置

下一篇:jquery - 时刻时区数据js错误: "has no data for &lt;!DOCTYPE html>"

相关文章:

html - 管理明显不同大小的多种字体

html - 如何让一大组图片向右浮动

css - 我希望我的下拉菜单右对齐而不是默认的左对齐

html - 响应式菜单项消失

php - 如何在 Magento 仪表板图中显示挂单

PHP正则表达式忽略字符串中的负数

php - 为什么需要设计 "404 not found"页?

php - MYSQL 和 PHP : SELECT subquery without result returns array key with empty value

css - <a> 标签内的文本未显示?

css - 如何创建网格元素的 1 和半 fr 宽度