html - 元素聚焦时如何删除蓝色矩形?

标签 html css

<分区>

如何在元素获得焦点时移除蓝色矩形?我见过类似的问题,但这些问题链接到外部站点。我的问题包括一个可以在 SO 上测试的片段。

这是我在文本区域获得焦点时得到的结果:

enter image description here

当文本区域获得焦点时,这是我想要的: enter image description here

这是我目前的代码:

input:focus, textarea:focus {
    outline: none;
}

#textarea  {
  position:absolute;
  top:10px;
  left:10px;
  right:10px;
  width:calc(100% - 20px);
  height:160px;
  display:inline-block;
  margin-top:-0.2em;
}
<textarea id="textarea">yo</textarea>

我已经看过这个question .
我也看过这个question .

最佳答案

试试这个:

input:focus, textarea:focus {
   outline: none !important; }

关于html - 元素聚焦时如何删除蓝色矩形?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50299193/

上一篇:jquery - 从某些元素的标题和第一个子元素中删除 href

下一篇:css - 如何去除使用线性渐变属性时出现的条纹

相关文章:

html - 外部位置 css 来包装固定内容?

html - 将图像作为数据 URI 存储在数据库 BLOB 中是否不好?

javascript - "Cannot set color of undefined"是什么意思?

html - 将包含其他相互依赖的 div 的 div 居中

javascript - 使用 NW.js (Node Webkit) 执行 Windows 文件/事件

javascript - ng-include 不加载指定文件的内容

javascript - 如何在 React.js 中显示下拉菜单和隐藏其他菜单

html - 为什么 float 和 padding 组合导致元素通过边距?

html - 悬停在跨度内不起作用

css - 我在哪里可以将任何自定义 CSS 添加到 angular-fullstack 应用程序中?