Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在Safari和Chrome中提交图像边框?_Html_Css_Button_Input - Fatal编程技术网

Html 在Safari和Chrome中提交图像边框?

Html 在Safari和Chrome中提交图像边框?,html,css,button,input,Html,Css,Button,Input,我有一个提交图像按钮: <input id="sbutton" type="image" value="&nbsp;" /> 它在Firefox中的Opera中工作得非常完美,按钮大小约为10x10px,在Safari和Chrome中它有一些奇怪的边框(比如iframes有),我不知道如何摆脱它 谢谢:)这是一个提纲吗?设置: #sbutton:active, #sbutton:focus { outline: none; } 试试看。试试: bord

我有一个提交图像按钮:

 <input id="sbutton" type="image" value="&nbsp;" />   
它在Firefox中的Opera中工作得非常完美,按钮大小约为
10x10px
,在Safari和Chrome中它有一些奇怪的边框(比如
iframes
有),我不知道如何摆脱它


谢谢:)

这是一个提纲吗?设置:

 #sbutton:active,
 #sbutton:focus
 {
  outline: none;
 }
试试看。

试试:

border:none;
而不是:

border:0;

这是这个问题的正确解决方案:

:active, :focus { outline: none; }

显然,对于没有src属性的图像输入,会发生这种情况。您可以给它一个src,如本文所示:


或者,如果您仍要设置背景图像,则可以使用type=“submit”输入而不是type=“image”。

将图像的类型更改为submit,因为我在CSS中使用背景图像,这解决了我的问题。

对于大小问题,请尝试添加
显示:块
。我很确定按钮是一个内联元素。给你:tinyurl.com/2ugzj6j它在Opera中正常工作,在Safari中有边框/Chrome O.O Firefox在点击时选择它。我猜输入图像不太受支持(?)。它不是一个轮廓,我猜它是所有输入的默认边框,边框:无和轮廓:无不会改变任何东西O.oDo你有一个活生生的例子吗?它可能从级联的更高层继承了一些值。屏幕截图也会有帮助。我会在几分钟后上传。给你:它在Opera中工作正常,在Safari/Chrome O.O中有边框。Firefox会在点击时选择它。我猜输入图像不太受支持(?)。有一个波兰404:404]文件找不到:Plik nie istnieje。
:active, :focus { outline: none; }