css - Chrome 突然覆盖样式表

标签 css google-chrome overriding stylesheet

不知道我昨晚做了什么,但现在我早上起床,chrome 似乎覆盖了我的 anchor 和输入样式。我希望我可以在这里发布一段代码,但我不知道是什么代码可能导致它。我不想把 !mportant 放在各处来修复它,所以我希望有人可以看看 test site并找出 chrome 不喜欢什么。 页面顶部的 headerWidget(电子邮件、电话和搜索)不应有装饰,并且应在悬停时改变颜色。我什至无法再将光标放在搜索输入中。导航菜单不应该有装饰,但悬停可以。去搞清楚。 Chrome 开发工具向我展示了这一点:

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

以及一堆用于输入的用户样式表条目

最佳答案

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

a的webkit的默认样式标签。

添加 CSS 选择器 #email a,#phone a然后把你想要的样式放进去。像这样:

#email a,#phone a{
    text-decoration:none;
}

对于悬停:

#email a:hover,#phone a:hover{
    color:red;
}

一个更好的选择器来定位 #headerWidgets 内的所有 anchor 标记

#headerWidgets a {
    color: #F00;
}

#headerWidgets a:hvoer {
    color: #CCC;
}

你无法再点击搜索框的原因是div#headerMenuWrapper挡住了去路。在开发工具上,将鼠标悬停在此元素 <div id="headerMenuWrapper" class="clearfix"> 上你会看到它覆盖 #headerWidgets

关于css - Chrome 突然覆盖样式表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23392518/

相关文章:

c++ - 从多个头文件中的接口(interface)声明重写函数时如何避免重复代码?

jquery - 如何通过数字选择某个对象?

java - 在通过 HTML 发送的 Gmail 中看不到图片

javascript - 扩展列表不移动容器/页脚

javascript - window.onfocus 事件不会在 Google Chrome 中触发?

c++ - 覆盖后调用原始继承函数

html - 让 parent 超越 child

javascript - Chrome 开发者工具 : Computed style different from css rule?

javascript - 使用 Microsoft IME 日语输入数字时,AngularJs ngModel 值重复

java - 重写 equals 方法来比较两个分数