删除默认焦点轮廓并更改为其他颜色 [英] Remove default focus outline and change to different color

查看:58
本文介绍了删除默认焦点轮廓并更改为其他颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的联系人框中删除蓝色轮廓(颜色与页面上的其他颜色冲突).我尝试了关于SO问题的一堆建议,但都没有成功,而在Chrome和Firefox上却得到了相同的结果.

I'd like to remove the blue outline from my contact box (the color clashes with the other colors on my page). I tried a bunch of things suggested on SO questions to no avail and get the same result on Chrome and Firefox.

这是我尝试过的:

input:focus, button:focus, textarea:focus, textarea:focus, input:active, button:active, textarea:active, input:active, input, textarea, button {
  outline-style: none !important;
  outline: none !important;
  outline: 0 !important;
  border: 1px solid #17a2b8; /* Turquoise color */
}

结果:

推荐答案

这是应用于焦点的box-shadow样式.

It's a box-shadow style applied on focus.

添加此代码以将其删除:

add this code to remove it:

.form-control:focus {
   box-shadow:none;
}

您可以添加!important,具体取决于您的CSS顺序:

You may add !important depending on your CSS order:

这篇关于删除默认焦点轮廓并更改为其他颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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