在此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-color
。 important
是必需的,因为它已在您的 css
中使用。所以我们需要再次使用它来覆盖之前的样式。
注意:!important
的使用被认为是不好的做法,我们应该尽可能避免。
.header:hover {
background: #7cedd7 !important;
}
关于html - 更改悬停颜色 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37270520/