简化了情况:上下两个表格<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;"这些都设置了啊
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;"这些都设置了啊
解决方案 »
- asp.net中能实现像QQ空间那样任意拖放模块吗?
- 子窗口的字符串往父窗口的datagrid中赋值?
- 怎样去匹配html标签未完成的结束标签呢
- 小问题,关于Model或数据库结构到底该怎么设计
- 急急急急急急 table 比较
- 请教一下,怎么在INSET INTO的时候,会出现"操作必须使用一个可更新的查询。"这样的错误?
- 请帮忙:两个dropdownlist相互关联问题?
- 高分请教问题:我做了个class(非web project),要在其中用到另一个web project 中的session对象,如何因用?
- 鸟哥初问(+100):点击一个服务器控件button后,page_load什么时候执行?
- 我的asp.net的服务器的Session总是丢失,为什么?
- mvc 视图引用强类型错误
- IE6、IE7、IE8 都兼容 下拉菜单
<img换成
<td><img
<%--头部表格(第一个表格)--%>
<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>
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> //放在一行显示这样就没有问题了啊。
究竟是什么把它撑大的呢???用“display:block”将区块转化为内敛块。或者<Img>标签和</td></tr>都可以解决留有缝隙的问题,着到底是怎么回事呢???