css - Chrome 边框问题

标签 css google-chrome border

我只有 chrome 有这个问题。如何去除图像周围的边框?请查看 chrome 中的 fiddle 。

<form>
    <input type="image" class="searchbox_submit search_btn" value="">
</form>
form input[type=text]:focus, form input[type=password]:focus, textarea:focus {
    outline: none;
}

.search_btn {
    background: url("http://static.ak.fbcdn.net/rsrc.php/v1/yu/r/yo348KDuskF.png") no-repeat scroll 0px -200px transparent;
    height: 25px;
    width: 30px;
    outline: none;
    border: none;
    outline-width: 0;
    -webkit-appearance: none; 
}​

演示: http://jsfiddle.net/TXYg6/

最佳答案

您正在使用 <input type="image" /> , 所以 a src attribute is expected .你没有指定一个,所以 Chrome 显示灰色边框,以同样的方式 it does for an img 没有src属性。

如果你想坚持使用<input type="image" />并使用 CSS sprite,您将必须指定 something 作为 src ,例如 1x1 透明“blank.gif”。

http://jsfiddle.net/thirtydot/TXYg6/14/

然而,这看起来很可怕。相反,我建议切换到 <input type="submit" /> ,这solves the problem .

关于css - Chrome 边框问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10542868/

相关文章:

html - 在导航栏上设置 css 不透明度

google-chrome - 没有链接的 Typescript blob 文件名

css - 如何仅在一侧设置 css 边框?

html - 网站容器不会包装?

html - Firefox - 从未装饰的复选框中删除边框

javascript - 提交后文本框为空

html - 在表格中添加对 Angular 线和虚线

javascript - 保存 html 页面 + 更改所有链接以指向正确的位置

android - Android 版 Chrome 根据分辨率以不同方式呈现字体

CSS 1px 高度问题 firefox 与 webkit 浏览器/ie