Remove default focus outline and change to differe

2020-04-07 04:17发布

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.

Here's what I tried:

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 */
}

Result:

Result

1条回答
家丑人穷心不美
2楼-- · 2020-04-07 05:23

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

enter image description here

add this code to remove it:

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

You may add !important depending on your CSS order:

查看更多
登录 后发表回答