Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.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 表单输入和提交按钮在同一行_Html_Css - Fatal编程技术网

Html 表单输入和提交按钮在同一行

Html 表单输入和提交按钮在同一行,html,css,Html,Css,我正在尝试创建搜索字段,现在除了chrome,所有浏览器上都是这样 这是它在chrome中的外观: 这是我的css: #search_input{ -moz-border-bottom-colors: none; -moz-border-image: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; border-color: #DEDEDE;

我正在尝试创建搜索字段,现在除了chrome,所有浏览器上都是这样

这是它在chrome中的外观:

这是我的css:

#search_input{
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #DEDEDE;
border-style: solid none solid solid;
border-width: 1px medium 1px 1px;
height:25px;
padding-left:3px;
}


#search_submit {
position: relative;
right: 4px;
top: 8px;
}
还有html:

<form action="#">
    <input id="search_input" type="text" name="search" />
    <input id="search_submit" type="image" src="../media/images/search_button.jpg" />
</form>

抱歉这么长的帖子,我只是想澄清一下,无论如何,我该如何用chrome解决这个问题

编辑这是按钮


输入由css完成,未使用图像。

图像大小错误

图像的高度必须为:

<height of input> + <padding of input> + <border of input>
= 25 + 0 + 2x1 = 27px
此外,您还必须定义一个宽度以保持外观一致。例如:

width: 50px;

另一种方法是将按钮放在输入字段内,并扩展正确的填充,以便焦点上的轮廓看起来更好:

图像的大小错误

图像的高度必须为:

<height of input> + <padding of input> + <border of input>
= 25 + 0 + 2x1 = 27px
此外,您还必须定义一个宽度以保持外观一致。例如:

width: 50px;

另一种方法是将按钮放在输入字段内,并扩展右边的填充,以便焦点上的轮廓看起来更好:

可以发布图像吗<代码>搜索按钮.jpg,是否用于测试?这是一个基本的开始:你能把这些图片按钮放在网络上的某个地方吗(或者更好地提供完整的例子),或者你能发布图片吗<代码>搜索按钮.jpg,是否用于测试?这是一个基本的开始:你能把这些图片按钮放在网络上的某个地方吗(或者更好地提供完整的例子)我现在没有时间测试你的解决方案,但我希望它能工作,谢谢你可以快速查看JSFiddles。我现在没有时间测试你的解决方案,但我希望它能工作,谢谢,您可以快速查看JSFiddles。