首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

chrome中为啥图片会离table边有一段距离

2012-12-14 
chrome中为什么图片会离table边有一段距离?最基本的table width100%trtd stylewidth:50pxim

chrome中为什么图片会离table边有一段距离?
最基本的
<table width="100%">
<tr>
<td style="width:50px;">
<img src="xxx.jpg" width="50">
</td>
<td>
</td>
</tr>
</table>

这样,图片右边总是有挺大的空隙,大概有20px左右。
为什么会这样呢。
[最优解释]

引用:
最基本的
<table width="100%">
<tr>
<td style="width:50px;">
<img src="xxx.jpg" width="50">
</td>
<td>
</td>
</tr>
</table>

这样,图片右边总是有挺大的空隙,大概有20px左右。
为什么会这样呢。

CSS 默认值在不同的浏览器不一样。 

<td style="width:50px;margin: 0 auto;">
[其他解释]
将table的 cellpadding 和 cellspacing 设置为 0。
[其他解释]
* {margin:0;border:0;padding:0}
[其他解释]
代码不全面,无法判断啊
[其他解释]
<body style="border:0px; padding:0px; margin:0px;">
<table width="100%">
 <tr>
 <td style="width:50px;">
 <img src="xxx.jpg" width="50">
 </td>
 <td>
 </td>
 </tr>
 </table>
 
</body>
这样就对了
[其他解释]
边距是设为0了,在IE中正常,就是在chrome中不行。

热点排行