Html 保证金:0自动;在IE9中使用struts 1

Html 保证金:0自动;在IE9中使用struts 1,html,css,internet-explorer,Html,Css,Internet Explorer,我有我的利润:0自动在Chrome中看起来不错,但在IE9中不起作用。在IE9中,整个站点在屏幕左侧是静态的。我根据一些建议添加了一个简单的重置css语句,但它们没有帮助 在main.css中: html, body { padding:0; margin: 0; } body { background-color: gray; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;

我有我的利润:0自动在Chrome中看起来不错,但在IE9中不起作用。在IE9中,整个站点在屏幕左侧是静态的。我根据一些建议添加了一个简单的重置css语句,但它们没有帮助

在main.css中:

html, body {
      padding:0; 
      margin: 0;
}

body {
    background-color: gray;
    font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size: 12px;        
}

.wrapper {
    width: 1009px;
    background-color:white;
    border-style:solid;
    border-color:#002663;
    padding:5px;
    margin: 0 auto;
    margin-top:25px;
}
更新:IE的开发工具面板中css的外观:

有人能看到我在哪些方面可以改进IE吗?谢谢

更新:按要求的实际html:

<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<head>
    <title>Search Page</title>
    <!-- Hostname: VDDP03A-FAEF32A -->
    <link rel="stylesheet" href="/CSA/styles/main.css" type="text/css" />
    <link rel="stylesheet" href="/CSA/styles/smoothness/jquery-ui-1.8.10.custom.css" type="text/css" />
    <script type="text/javascript" src="/CSA/scripts/jquery-1.10.2.min.js" ></script>
    <script type="text/javascript" src="/CSA/scripts/jquery-ui-1.10.3.js" ></script>
    <script type="text/javascript" src="/CSA/scripts/jquery.validate.js" ></script>

</head>
<body >
<div class="wrapper">
    <table width="100%" border="0" cellpadding="0" style="margin:0;">
    <tr>
    <td>
    <img src="/CSA/images/logo.jpg" width="300" align="top-left" border="0" style="margin:0;" alt="myLogo">
    </td>
    <td width="50%">
    <br />
    <h2 style="font-weight:normal;align:right;color:#002663;margin:0;">Title</h2>
    </td>
    <td>
    </td>
    </tr>
    </table>
    <hr color="#002663" style="margin:0;">


<form name="form1" method="post" action="/CSA/web/CSA.do" style="margin:0;">
    <input type="hidden" name="searchType" value="myValue">
    <table width="1000px" border="0" cellpadding="0" style="margin:0;">
        <col width="285px" />
        <col width="300px" />
        <col width="278px" />
        <col width="137px" />

        <tr style="margin:0;">
            <td colspan="4">
                <h4 style="color:#002663;margin-bottom:10;margin-top:3;">Search 1:</h4>
        </tr>
        <tr style="margin:0;">
            <td style=" padding-left:100px; padding-bottom:0px; width:185px;" >
            options :
            <input type="radio" name="options" value="OP1" style="border:none;">
            OP1
            <input type="radio" name="options" value="OP2" style="border:none;">
            OP2 

            </td>
            <td>
                Search Criteria&nbsp;:&nbsp;<input type="text" name="criteria" maxlength="20" size="20" tabindex="1" value="" id="searchField1">
            </td>
            <td style="min-width: 268px;">
                Date&nbsp;:&nbsp;
                <input type="text" name="lossDate" maxlength="10" size="11" value="07/19/2013" id="datepicker">


            </td>
            <td style="min-width: 138px;">
                <input type="submit" name="submit" tabindex="3" value="Search" id="submit" style="margin-top:5;">&nbsp;&nbsp;&nbsp; 
                <input type="reset" name="reset" tabindex="4" value="Reset" id="reset" style="margin-top:5;">
            </td>
        </tr>
    </table>
</form>

<!-- Three more forms similar to the above -->

<hr color="#b0b1b2" style="margin:3;">

<table table width="1000px" border="0" cellpadding="0">
        <tr style="margin:0;">
            <td style="margin:0;">
                <h4 style="color:#002663" style="margin-bottom:8;margin-top:3;">Search Results:</h4>
            </td>
        </tr>



    <div styleId="errors"  style="margin:0;">

    </div>
</table>
</div>
</body>
</html>

搜索页面

标题
搜索1: 选项: OP1 凤凰社2 搜索条件: 日期:
搜索结果:
试试看

如果有机会,请查阅重置css

更新:

我建议你把身体标签的宽度去掉,放在一个小隔间里

我的小提琴使用自动边距显示固定宽度的div。如果你取下主体css,你会看到一些空间

你也可以发布你的html吗请试试

如果有机会,请查阅重置css

更新:

我建议你把身体标签的宽度去掉,放在一个小隔间里

我的小提琴使用自动边距显示固定宽度的div。如果你取下主体css,你会看到一些空间


你也可以发布你的html吗?请尝试在你的body标签上添加
margin:0 auto

body {
    /* background-position: 5px 5px;
    background-repeat: no-repeat; */
    background-color: gray;
    font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size: 12px;
    width: 1010px;
    margin: 0 auto; /* <--*/
}
正文{
/*背景位置:5px 5px;
背景重复:无重复*/
背景颜色:灰色;
字体系列:Verdana、Geneva、Arial、Helvetica、sans serif;
字体大小:12px;
宽度:1010px;

边距:0自动;/*尝试在您的body标签上添加
边距:0自动

body {
    /* background-position: 5px 5px;
    background-repeat: no-repeat; */
    background-color: gray;
    font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size: 12px;
    width: 1010px;
    margin: 0 auto; /* <--*/
}
正文{
/*背景位置:5px 5px;
背景重复:无重复*/
背景颜色:灰色;
字体系列:Verdana、Geneva、Arial、Helvetica、sans serif;
字体大小:12px;
宽度:1010px;
页边距:0自动;/*

Doctype必须是文档中的第一个内容。它位于
开始标记之前

把它放在你拥有的地方是无效的,并且会触发怪癖模式(在怪癖模式下,各种各样的东西都会断开)。


Doctype必须是文档中的第一个内容。它位于
开始标记之前



把它放在你拥有的地方是无效的,并且会触发怪癖模式(在怪癖模式下,各种各样的东西都会破裂).

你是从CSS重置开始的吗?p.S.-这在客户端上是100%,与Java或Struts无关。ie9可能在body标签上有默认的填充或边距,请尝试将body的填充/边距设置为0,你使用哪种doctype?看起来很像IE的怪癖模式行为…请向我们展示实际的HTML,而不是Struts模板。你有没有从CSS重置开始?P.S.-这在客户端上是100%,与Java或Struts无关。ie9可能在body标记上有默认的padding或margin,尝试将body的padding/margin设置为0您使用哪种doctype?看起来很像IE的怪癖模式行为…请显示实际的HTML,而不是Struts模板。不幸的是,did不起作用。我不确定我做得是否正确。请查看我的编辑。我已尝试根据您的建议进行更改。在除IE之外的所有浏览器中都很好。可能是我现在正在测试的表,它对我来说很好。我注意到您的包装上有填充,以便在包装和表之间创建一个小间距。您应该是使用IE dev工具,您可以判断是什么原因造成了空间。如果有必要,请拍摄一个屏幕截图。这应该不难理解。确保屏幕截图捕获了整个IE浏览器。不幸的是,这不起作用。我不确定我是否做对了。请查看我的编辑。我已尝试根据您的建议进行更改。在一个特定的环境中仍然看起来不错所有浏览器,但IE。可能是我现在测试的表,我觉得很好。我注意到你的包装上有填充物,这样会在包装器和表之间创建一个小间距。你应该能够通过IE开发工具知道是什么导致了空间。如果必须的话,拍一张屏幕截图。这应该不难弄清楚。确保电子屏幕截图捕获了整个IE浏览器哇,很简单。谢谢@Quentin.哇,很简单。谢谢@Quentin。
<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">