Bootstrap按钮 - 删除Chrome OS上的大纲
我希望实现这一目标: http://getbootstrap.com/javascript/javascript/#popovers-examples-examples-examples-exmples - 按下了OS X上的Chrome中的红色弹出式按钮。。。。。
演示”并
它在Safari和Firefox中看起来正确,但在Chrome中没有一个!
I am looking to achieve this:
http://getbootstrap.com/javascript/#popovers-examples - scroll to the "live Demo" and hit the red popover button, in Chrome on OS X.... It's perfect beautiful
However, in my own code it outlines blue, despite a litany of CSS efforts from me to remove this!
It looks correct in Safari and Firefox but a no go in Chrome!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(20)
在Bootstrap 4中,该轮廓不再使用,而是盒子阴影。如果是您的情况,请执行以下操作:
In bootstrap 4 the outline is no longer used, but the box-shadow. If it is your case, just do the following:
与SCSS:
With scss:
.btn.Active
或.btn.focus
单独不能替代 Bootstrap的样式。对于默认主题:.btn.active
or.btn.focus
alone cannot override Bootstrap's styles. For default theme:最简单的解决方案是:创建一个CSS文件并输入以下内容:
The simplest solution is: Create a CSS file and type this:
您可以在不做任何额外的CSS的情况下删除阴影。
通常添加这样的按钮。
< button class =“ btn btn-primary”> button</button>
您可以简单地添加
shadow> shadow> shadow-none
即可删除轮廓。< button class =“ btn btn-primary shadow-none”> button</button>
You can remove the shadow without doing any extra CSS yourself.
Normally add a button like this.
<button class="btn btn-primary">Button</button>
You can simply add
shadow-none
to remove the outline.<button class="btn btn-primary shadow-none">Button</button>
这将删除它 - 简短干净:
This will remove it - short and clean:
这是解决方案:
这有效100%希望它对您有所帮助。
Here's the solution:
This works 100% hope it helps you.
搜索并替换
为
Search and replace
Replace to
如果以上答案仍然不起作用,请添加以下内容:
If the above answers still do not work, add this:
压力如此压力后,它适用于我的bootstrap按钮
It worked for my bootstrap button after a such stress
您可以将此标签放入HTML。
我之所以使用焦点,是因为OnClick仍然显示了微秒的光芒,并在使用它方面使闪光看起来很可怕。在所有CSS方法失败之后,这似乎被摆脱了。
you can put this tag into your html.
I used on focus because onclick still displayed the glow for a microsecond and made a horrible looking flash in terms of using it. This seemed to get rid after all the css methods failed.
CSS从Mixins文件夹中的“ Tab-cocus.less”中进行了(可能很难找到,因为Mixins在Chrome Dev-Tool中未显示)。因此,您应该编辑此:
That CSS goes from this file "tab-focus.less" in mixins folder (it could be difficult to find, because mixins are not shown at chrome dev-tools). So you should edit this:
在Bootstrap源SASS文件的Mixins中,删除所有
$ border
参考(不在大纲中)。或简单地代码您拥有_custombutton.scss mixin。
In the mixins of the Bootstrap sources Sass files, remove all
$border
references (not in the outline variant).Or simply code you own _customButton.scss mixin.
如果有人使用bootstrap sass注意,则代码在_reboot.scss文件上,例如:
,如果您想保留_reboot文件,我想可以随意使用普通的CSS覆盖,而不是尝试寻找可变的变量来更改。
If someone is using bootstrap sass note the code is on the _reboot.scss file like this:
So if you want to keep the _reboot file I guess feel free to override with plain css instead of trying to look for a variable to change.
Bootstrap 5及以上
.btn-primary {-bs-bs-btn-pocus-shadow-rgb:none;}
Bootstrap 5 and up
.btn-primary {--bs-btn-focus-shadow-rgb: none;}
如果您使用的是Bootstrap v5.1或任何其他版本。要删除Bootstrap Navbar切换按钮的大纲执行此操作:
希望这个答案对您有帮助。
If you are using bootstrap v5.1 or any other version. To remove the outline of your bootstrap navbar toggle button do this:
Hope this answer will help you.
我看到
.btn:focus
上有一个概述
:尝试将其更改为:
基本上,在
上查找
ed元素 - 这就是导致它的原因。概述
的任何实例:focus更新 - 用于Bootstrap V4:
I see
.btn:focus
has anoutline
on it:Try changing this to:
Basically, look for any instances of
outline
on:focus
ed elements — that's what's causing it.Update - For Bootstrap v4:
对于像我这样的任何Googles,
在Google Chrome中仍然无法使用的任何Googles,以下内容应完全删除任何按钮光泽。
For any googlers like me, where..
still didn't work in Google Chrome, the following should completely remove any button glow.
这应该删除轮廓和盒子阴影
This should remove outline and box shadow