html - 更改悬停颜色 CSS

标签 html css hover

在此Website主页上有 4 个选项卡。当我将鼠标悬停在选项卡上时,如何更改蓝绿色?

a {
    -webkit-transition-property: color;
    -moz-transition-property: color;
    transition-property: color;
    -webkit-transition-duration: 0.3s;
    -moz-transition-duration: 0.3s;
    transition-duration: 0.3s;
}
a {
    color: #00e1b6;
    line-height: inherit;
    text-decoration: none;
}
*, *:before, *:after {
    -webkit-box-sizing: inherit;
    -moz-box-sizing: inherit;
    box-sizing: inherit;
}

a:-webkit-any-link {
    color: -webkit-link;
    text-decoration: underline;
    cursor: auto;
}

最佳答案

css 文件末尾添加以下 css 规则以更改 background-colorimportant 是必需的,因为它已在您的 css 中使用。所以我们需要再次使用它来覆盖之前的样式。

注意:!important 的使用被认为是不好的做法,我们应该尽可能避免。

.header:hover {
    background: #7cedd7 !important;
}

关于html - 更改悬停颜色 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37270520/

相关文章:

css - 尝试将鼠标悬停在列表项上时,子菜单列表不会保留

html - 将 Google 相册相册嵌入 HTML

wpf - Windows 8 下的 WPF 和 Silverlight 的 future 会怎样?

css - 无法为未选中的复选框设置背景颜色

html - 将 CSS 形状的悬停区域限制为 :after

CSS:悬停状态图像缓存

html - 这个垂直导航菜单容器没有弹出?

css - 在响应式设计中让 div 从右到下

javascript - 我试图让每个 "onclick"事件重复该功能

html - Firefox 中的等高列 (CSS)