1

我有一个 Div 标签,由于某种原因,它在左侧填充了大约 50 像素。

以下是 html,请注意“类”的 nono 有 padding-left”

<body>
    <div class="popHeaderMain" align="center">
        <div class="PopHeader">
            Keller Williams Realty | (704) 602-0271
        </div>
        <div class="popLoginHeader">
            <table>
                <tr>
                    <td style="font-size:10px;">Username: <input type="text" name="username" /></td>
                    <td style="font-size:10px;">Password: <input type="password" name="password" /></td>
                    <td style="vertical-align:bottom;"><input name="login" type="submit" value="Login" /></td>
                </tr>
            </table>
        </div>
    </div>
    <!-- ImageReady Slices (backgroundPage.psd) -->
    <div style="padding-top:20px; width:900px;" align="center">
        <table id="Table_01" width="900" height="1200" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;">
            <tr>
                <td rowspan="2" style="background-image:url(images/backgroundPage_01.png); background-repeat:no-repeat; width:20px; height:410px;">
                <td rowspan="2" style="padding-top:8px; background-image:url(images/backgroundPage_02.png); background-repeat:no-repeat; height:380px; width:455px;">
                    <div style="padding-left:25px; padding-top:0px; font-family:Arial, Helvetica, sans-serif; font-size:18px; font-weight:bold; color:#F0F0F0;">
                        Preview House Address
                    </div>
                    <div style="padding-top:20px; width:450px;">
                        <div style="padding-left:10px;">
                            <img src="images/GibsonHouse3.jpg" alt="GibsonHouse" border="0" style="width: 437px; height: 300px;"/>
                        </div>
                    </div>
                </td>
                <td style="padding-top:0px; background-image:url(images/backgroundPage_03.png); background-repeat:no-repeat; width:405px; height:58px;">
                    <div style="padding-top:0px; padding-left:50px; font-family:Georgia, 'Times New Roman', Times, serif; font-size:14px; heigh:58px;">Preview House 1 out of N of houses in area</div>
                </td>
                <td rowspan="2" style="background-image:url(images/backgroundPage_04.png); background-repeat:no-repeat; width:20px; height:410px;">
            </tr>
            <tr>
                <td style="background-image:url(images/backgroundPage_05.png); background-repeat:no-repeat; width:405px; height:352px;"></td>
            </tr>
            <tr>
                <td style="background-image:url(images/backgroundPage_06.png); background-repeat:no-repeat; width:20px; height:766px;"></td>
                <td colspan="2" style="background-image:url(images/backgroundPage_07.png); background-repeat:no-repeat; width:860px; height:766px;"></td>
                <td style="background-image:url(images/backgroundPage_08.png); background-repeat:no-repeat; width:20px; height:766px;"></td>
            </tr>
            <tr>
                <td style="background-image:url(images/backgroundPage_09.png); background-repeat:no-repeat; width: 20px; height:24px;"></td>
                <td colspan="2" style="background-image:url(images/backgroundPage_10.png); background-repeat:no-repeat; width:860px; height:24px;"></td>
                <td style="background-image:url(images/backgroundPage_11.png); background-repeat:no-repeat; width:20px; height:24px;"></td>
            </tr>
        </table>
    </div>

谁能帮帮我

4

3 回答 3

1

padding-left 幻影实际上是从 body 标记继承的。宽度设置为 800 像素而不是 900 像素。

于 2010-10-19T03:28:09.057 回答
0

我没有看到任何异常的左侧填充。表格左侧有一个空单元格,宽 20 像素。你是这个意思吗?尝试暂时将表格的边框属性更改为边框 =“1”,以更好地了解单元格的位置。

为了在 Firefox 中进行测试,如果您还没有 Firebug,我强烈建议您使用它。许多好处之一是,当您将鼠标悬停在 HTML 选项卡中的元素上时,您会看到它们的填充突出显示。

于 2010-10-19T03:13:34.973 回答
0

您的正文标签宽度设置为 800 像素。将其更改为 900 像素。:)

于 2010-10-19T04:35:09.883 回答