input type =“image”在Chrome中显示不需要的边框 [英] input type=“image” shows unwanted border in Chrome

查看:542
本文介绍了input type =“image”在Chrome中显示不需要的边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

html:

<input type="image" />

css:

input[type="image"]
  {  border:0;
     border-color:transparent;
     background:transparent;
     width:150px;
     outline:none;
  }

我不想使用src =img url使用background:(url)
i已添加边框:0,但仍然有边框在chrome中。

i don't want to use src="img url", i want to use background:(url) i have added border:0 but still border is coming in chrome

JSFiddle> http://jsfiddle.net/akash4pj/PYKfr/1/

JSFiddle > http://jsfiddle.net/akash4pj/PYKfr/1/

推荐答案

src 属性中添加1x1 GIF将解决问题:

Add an 1x1 GIF to the src attribute will solve the problem:

<input type="image" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" />



JSFiddle



您可以在这里找到类似问题的答案: chrome border issue

这篇关于input type =“image”在Chrome中显示不需要的边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆