css 删除输入周围的边框(Chrome,Safari)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 删除输入周围的边框(Chrome,Safari)相关的知识,希望对你有一定的参考价值。

/*
* === Remove border around the inputs (Chrome, Safari) ===
*/

/*
* — When an input element set to focus in WebKit browsers like Safari and Chrome, the browser will put a blue/yellow/red border around it.
This could be confusing and could make your design look different. To disable this you can use the following css. —
*/

/* remove border around all input elements */
input:focus {
    outline: none;
}

/* remove border around all textarea elements */
textarea:focus {
    outline: none;
}

/* remove border around all select elements */
select:focus {
    outline: none;
}

/* remove border around all input,textarea and select elements */
input:focus, textarea:focus, select:focus {
    outline: none;
}

/* remove border around all elements */
:focus {
    outline: none;
}

以上是关于css 删除输入周围的边框(Chrome,Safari)的主要内容,如果未能解决你的问题,请参考以下文章

在 Chrome 中删除精灵图像周围的边框

chrome/safari 显示图像周围的边框

圆角周围的 Chrome 图像边框消失

删除点击按钮周围的边框[重复]

CSS/HTML:在输入字段周围创建发光边框

如何在 div 或 iframe 等其他元素上模拟活动输入或 textarea 周围的 Chrome/Safari 边框?