chrome输入框阴影 [英] box-shadow on inputs in chrome

查看:74
本文介绍了chrome输入框阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何阻止Chrome将网站的输入框泛黄?

我遇到了一个我无法解决的小错误,基本上我有:

I've come across a little bug that I'm unable to solve, basically I have:

    input:focus {
        border: 1px solid #38a9f0;
        -webkit-box-shadow: 0px 0px 5px rgba(56, 169, 240, 0.75);
        -moz-box-shadow: 0px 0px 5px rgba(56, 169, 240, 0.75);
        box-shadow: 0px 0px 5px rgba(56, 169, 240, 0.75);
    }

在用户选择框时为框设置样式,但是chrome已经有一个默认焦点为黄色,因此与上面的颜色一起将其变为非常暗和丑陋的绿色。有什么方法可以替代chrome默认颜色吗?

to style the boxes when a user selects it, however, chrome already has a default on focus which is yellow, so along with the above it turns it to a very dark and ugly green. Is there any way to override chromes default colours?

问候,
Karl

Regards, Karl

推荐答案

此处有一个问题,您可以简单地使用以下CSS覆盖轮廓,但请确保(按照您的意愿)将其替换为焦点指示。

As pointed out in this SO question here you can simply use the following CSS to override the outline, but do make sure (as you said you would) that you replace it with some indication of focus.

input[type="text"], input[type="password"], textarea, select { 
  outline: none;
}

您可以简单地使用概述:无; 件,如果您只需要那一部分,那只是覆盖所有潜在轮廓的方法。

You can simple use the outline: none; piece if that's all you need, that is simply the way to override all of the potential outlines.

这篇关于chrome输入框阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆