html - 焦点上边框颜色不改变

标签 html css

以下是我的代码,焦点上的边框没有变化,我做错了什么?我尝试了很多方法,但没有任何效果

<input type="text" spellcheck="false" data-placement="top" id="writeWord" autocorrect="off" autocapitalize="off" maxlength="200" style="width: 230px;border: 0;border-bottom: 2px solid #C8C6C6;border-radius: 0;color:#6e572f;font-size:24px;font-weight:500;">

#writeWord:focus{ outline: 0; border-color:#ea6e01;}

http://jsfiddle.net/brdrn4d3/

最佳答案

这是因为inline styling is more specific比样式表中的样式更重要。

您可以使用以下内容:

Updated Example

#writeWord {
    border: none;
    border-bottom: 2px solid #C8C6C6;
}
#writeWord:focus {
    outline: 0;
    border: 1px solid #ea6e01;
}

关于html - 焦点上边框颜色不改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28534071/

相关文章:

html - 捕获输入类型=文件的取消事件

jquery - 如何获取包含内容的文本区域?

javascript - Grunt、Gulp.js 和 Bower 之间有什么区别?为什么以及何时使用它们?

css - 如何使用 flex 修复页脚上方的按钮

html - 使用@media 改变定位

html - 如何首先放置 ionic 标签?

html - 溢出时的 webkit 转换 :auto div results in very wide scrollbar in Chrome/Safari

html - 如何从div的开头到结尾建立链接

html - 空 div(样式为 : height) will not display

html - 在导航栏中使用 HTML flex/CSS 在左侧显示 Logo ,在右侧显示菜单