Html google chrome在选择文本时显示边框
在上面的提琴中没有背景或边框颜色 但当我点击或选择时,文本边框会出现在谷歌浏览器中 标记Html google chrome在选择文本时显示边框,html,css,google-chrome,Html,Css,Google Chrome,在上面的提琴中没有背景或边框颜色 但当我点击或选择时,文本边框会出现在谷歌浏览器中 标记 <div id="ja-component"> <div id="fit-scroll" style="height: 505px; overflow: hidden; padding: 0px; width: 289px;" class="jspScrollable" tabindex="0"> <p>some text</p> </
<div id="ja-component">
<div id="fit-scroll" style="height: 505px; overflow: hidden; padding: 0px; width: 289px;" class="jspScrollable" tabindex="0">
<p>some text</p>
</div>
</div>
一些文本
如何解决此问题?使用
*:focus {
outline: none;
}
*:focus {
outline: none;
}
您需要添加“大纲:0;”作为“div#fit scroll”样式。
我建议不要使用内联样式,但根据您的演示,您应该添加:
div id="fit-scroll" style="box-shadow:0; outline: 0; height: 505px; overflow: hidden; padding: 0px; width: 289px;" class="jspScrollable" tabindex="0">
当每个输入元素被聚焦时,Chrome会在每个输入元素周围放置这个黄色边框(实际上是一个轮廓),作为默认设置(通过用户代理样式表)。
通过将以下代码放入css中,可以覆盖此默认值:
它应该可以做到这一点…提示您输入代码是有原因的,而不仅仅是JSFIDLE的链接。提示:这不是对您的漏洞查找技能的测试。以可访问性的名义,请不要这样做。仅键盘用户需要能够看到他们的焦点所在。我建议逐个元素禁用大纲并确保用明显的焦点样式替换它。
*:focus {
outline: none;
}