html - 输入字段焦点在 Chrome 和 Firefox 中的不同行为

标签 html css firefox

问题来了,我有一个输入字段,我设置了:

outline: none !important;

在 Chrome 中,当我输入一些字母时,它工作正常。但是,当我在 Firefox 中测试它时,出现了紫色的焦点边框。

如何禁用它?

这是 html 文件:

    <html>
    <head>
    <style type="text/css">

    .input-large{

    position: absolute;
    width: 800px;
    margin: 0 auto;;
    background: transparent;
    font-size: 150px;
    text-align: left;
    border: 0;
    letter-spacing: 35px;
    outline: none !important;
    font-family: Courier New !important;


    }

    </style>
    </head>
    <body>


    <input class="input-large" type="text" pattern="[0-9]*" maxlength="5" size="5" autofocus>


    </body>
    </html>

最佳答案

input {
     -moz-box-shadow: none;
}

在 mozilla firefox 中将输入框阴影设置为无。 尝试使用它,它对我来说效果很好。

关于html - 输入字段焦点在 Chrome 和 Firefox 中的不同行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18247028/

相关文章:

html - 使用 Firefox 查看网页时出现奇怪的中断

javascript - 在 Firefox 中设置 top.location.hash 为 %20

javascript - 拖动源容器时,jsPlumb 源端点不会移动

javascript - 如何在 HTML5 Video 元素上获取视频的 FrameRate

javascript - 动画按钮的问题

html - 将元素包装到下一行,并保持之间和周围的空间相等

css - Firefox CSS 表格 - 内容转移

html - Bootstrap - 如何在一个 div 行中以相等的宽度容纳 7 列并且没有浪费

javascript - Google Firebase 身份验证后切换 HTML 页面(非异步)

javascript - CSS调整图像大小,保持排列