简化了情况:上下两个表格<table>,在IE6/7下时,中间会留出缝隙。而在,IE8/9下时,却不会有缝隙,请问这是为什么呢???IE6/7下:
IE8/9下:
对应的HTML如下:
<div>
    <center>
    
    <%--头部表格(第一个表格)--%>
        <table   style="width:1004px; height:242px; margin:0px; border-style:none;" cellpadding="0" cellspacing="0" border="0"  >
        <tr><td>
            <img src="Pic/defualt_01.gif" usemap="#top" style=" border-width:0px; border-style:none;" />
        </td></tr>
        </table>
   
   
    <%--主体表格(第二个表格)--%>
    <table width="1004" cellpadding="0" cellspacing="0" border="0" style="margin:0px;  border-style:none;" >
    <tr><td width="36" style=" background-image:url(Pic/defualt_02.jpg)"></td>
    <td width="201" align="center" valign="top">
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    </td><td width="734"></td>
    <td width="33" style=" background-image:url(Pic/defualt_05.jpg)"></td></tr>
    </table>
        
    
    </center>
    </div>问题:为什么会出现缝隙,怎样才可以去除缝隙???什么属性设置的不对呢
cellpadding="0" cellspacing="0" border="0" style="margin:0px;  border-style:none;"这些都设置了啊

解决方案 »

  1.   

    <td>
      <img换成
    <td><img
      

  2.   

    css样式兼容性问题 ie6的浏览器不识别 cs3的样式的
      

  3.   

    干掉table 果断选择div才是你的选择。我一般都是拿div+css拼成table兼容性很好
      

  4.   

    兼容的问题很让人头疼的,主要看你CSS样式定义的哪里有问题
      

  5.   

    最好使用这个,否则一格式化还是要修改的
     <%--头部表格(第一个表格)--%>
                <table style="width: 1004px; height: 242px; margin: 0px; border-style: none;" cellpadding="0"
                    cellspacing="0" border="0">
                    <tr>
                        <td style=" background-image:url(Pic/defualt_01.jpg)">
                            <%--<img src="Pic/defualt_01.gif" usemap="#top" style="border-width: 0px; border-style: none;" />--%>
                        </td>
                    </tr>
                </table>
      

  6.   


    img{display:block;}加载样式表里,转化为区块。或者把
    <tr><td>
            <img src="Pic/defualt_01.gif" usemap="#top" style=" border-width:0px; border-style:none;" />
            </td></tr>
    转换为:
    <img src="Pic/defualt_01.gif" usemap="#top" style=" border-width:0px; border-style:none;"/></td></tr>  //放在一行显示这样就没有问题了啊。
      

  7.   


    究竟是什么把它撑大的呢???用“display:block”将区块转化为内敛块。或者<Img>标签和</td></tr>都可以解决留有缝隙的问题,着到底是怎么回事呢???