选择文本时谷歌浏览器出现边框

时间:2013-06-27 04:11:15

标签: html css google-chrome

Demo

在上面的小提琴中没有背景或边框颜色 但是当我点击或选择文字边框出现在谷歌浏览器中。

标记

<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>

我该如何解决这个问题?

4 个答案:

答案 0 :(得分:2)

使用

*:focus {
    outline: none;
}

Demo

答案 1 :(得分:0)

你需要添加“outline: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">

Demo

答案 2 :(得分:0)

当每个输入元素聚焦时,Chrome会将这个黄色边框(实际上是一个轮廓)作为默认设置(通过用户代理样式表)。 您可以通过将以下代码放入css来覆盖此默认值:

*:focus {
    outline: none;
}

答案 3 :(得分:0)

*:focus {
    outline: none;
}

应该这样做......