Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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 表单标记在IE中创建不需要的换行符_Html_Css_Internet Explorer - Fatal编程技术网

Html 表单标记在IE中创建不需要的换行符

Html 表单标记在IE中创建不需要的换行符,html,css,internet-explorer,Html,Css,Internet Explorer,我有一个使用谷歌定制搜索引擎的网页。我想让它更漂亮,所以我创建了一个环绕区域的包装器,基本上将搜索区域设置为一个圆角矩形。为此,我使用以下代码: <table style="height:33px;" border="0" cellpadding="0" cellspacing="0"> <tr> <td style="background-image:url(/leftEdge.png); height:33px; width:5px;">&am

我有一个使用谷歌定制搜索引擎的网页。我想让它更漂亮,所以我创建了一个环绕区域的包装器,基本上将搜索区域设置为一个圆角矩形。为此,我使用以下代码:

<table style="height:33px;" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td style="background-image:url(/leftEdge.png); height:33px; width:5px;">&nbsp;</td>
    <td style="background-image:url(/bg.png); height:33px; background-repeat:repeat-x;">
      <form name="cse" id="searchbox_demo" action="http://www.google.com/cse">
        <input type="hidden" name="cref" value="" />
        <input type="hidden" name="ie" value="utf-8" />
        <input type="hidden" name="hl" value="" />
        <input name="q" type="text" size="32" />
        <input type="submit" name="sa" value="Search" />
      </form>

      <script type="text/javascript" 
        src="http://www.google.com/cse/tools/onthefly?form=searchbox_demo&lang="></script>
    </td>
    <td style="background-image:url(/rightEdge.png); height:33px; width:5px;">&nbsp;</td>
  </tr>
</table>

这段代码在Chrome中看起来不错。但是,在Internet Explorer中,右边缘图像显示在下一行。IE似乎正在添加换行符。然而,我不知道如何摆脱它。迄今为止,我已尝试:

  • 将我的DocType更改为:
  • 添加以下CSS:
    表单{margin:0;padding:0;}
我不知道还能做什么。有人能帮我解决这个问题吗


谢谢大家!

我不喜欢表格,所以我使用CSS和DIV重新制作了它:

<div style="height:33px; width:290px">
    <div style="background-image:url(/leftEdge.png); height:33px; width:5px; float:left;margin:0; padding:0;"></div>
    <div style="background-image:url(/rightEdge.png); height:33px; width:5px; float:right;margin:0; padding:0;"></div>

    <div style="background-image:url(/bg.png); height:33px; background-repeat:repeat-x;margin:0; padding:0;">
      <form name="cse" id="searchbox_demo" action="http://www.google.com/cse" style="margin:0; padding:0;">
        <input type="hidden" name="cref" value="" style="margin:0; padding:0;" />
        <input type="hidden" name="ie" value="utf-8" style="margin:0; padding:0;" />
        <input type="hidden" name="hl" value="" style="margin:0; padding:0;" />
        <input name="q" type="text" size="32" style="margin:0; padding:0;" />
        <input type="submit" name="sa" value="Search" style="margin:0; padding:0;" />
      </form>

      <script type="text/javascript" src="http://www.google.com/cse/tools/onthefly?form=searchbox_demo&lang="></script>
    </div>
</div>


它有点脏,但我希望它会有帮助。

添加
表单{margin:0;padding:0;}
为我修复了它。你能不能制作一个小页面来演示这个问题,并发布整个代码?