删除默认焦点轮廓并更改为不同的颜色

Nat*_*lie 7 css twitter-bootstrap bootstrap-4

我想从我的联系框中删除蓝色轮廓(颜色与我页面上的其他颜色冲突)。我尝试了很多关于 SO 问题的建议但无济于事,并在 Chrome 和 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 */
}
Run Code Online (Sandbox Code Playgroud)

结果:

结果

Tem*_*fif 7

这是一种box-shadow应用于焦点的风格。

在此处输入图片说明

添加此代码以将其删除:

.form-control:focus {
   box-shadow:none;
}
Run Code Online (Sandbox Code Playgroud)

您可以!important根据您的 CSS 顺序添加: