zoukankan      html  css  js  c++  java
  • 上下两个表格之间为什么中间会有大约5象素的间距?

    今天发现一个问题:上下两个表格中间有大约5象素的间距。
    代码是这样的

    <!--head-->
        <div align="center">
            <table width="778" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <img src="images/head.gif"></td>
                </tr>
            </table>
        </div>
        <!--end head-->
        <!--menu-->
        <div align="center">
            <table width="778" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <img src="images/menu_1.gif" width="8" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_2.gif" width="668" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_3.gif" width="13" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_4.gif" width="67" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_5.gif" width="22" height="37" alt=""></td>
                </tr>
            </table>
        </div>
        <!--end menu-->

    最后经过调试,终于发现是因为head中image的宽度和高度没有设定。改成下面的代码即可。

    <!--head-->
        <div align="center">
            <table width="778" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <img src="images/head.gif" width="778" height="98" alt=""></td>
                </tr>
            </table>
        </div>
        <!--end head-->
        <!--menu-->
        <div align="center">
            <table width="778" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <img src="images/menu_1.gif" width="8" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_2.gif" width="668" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_3.gif" width="13" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_4.gif" width="67" height="37" alt=""></td>
                    <td>
                        <img src="images/menu_5.gif" width="22" height="37" alt=""></td>
                </tr>
            </table>
        </div>
        <!--end menu-->

    如果还有间隔的话,把<td><img src="" width="" height=""></td> 中间不要留空格。

  • 相关阅读:
    Netty源码剖析-关闭服务
    Netty源码剖析-断开连接
    Netty源码剖析-发送数据
    Netty源码剖析-业务处理
    Netty源码剖析-接受数据
    Netty源码剖析-构建链接
    html中调用silverlight中的方法
    在Silverlight宿主html页面添加按钮无法显示
    win7旗舰版在安装vs2010后向sql2008添加SQL_Server_Management详解
    javascript arguments
  • 原文地址:https://www.cnblogs.com/ami/p/455768.html
Copyright © 2011-2022 走看看