0

在 IE 中,导航栏位置正确,位于顶部居中。但是在 FF 中,它一直向右移动。我已经查看了代码,但仍然无法弄清楚。有任何想法吗?提前致谢!

#wrapper
{
display: block;
border: 0px solid red;
width: 896px; /*background:white;*/
margin: 0em auto;
padding: 0em;
display: block;
text-align: left;
height: auto;
}
#wrapperInner
{
display: block;
border: 0px solid red;
width: 896px; /*background:white;*/
margin: 0em auto;
padding: 0em;
display: block;
height: auto;
}

/*Menu----------------------------------------------------*/

/*------Tabs---------*/

#tabNav
{
width: 895px;
border: 0px solid red;
}

#tabNav table
{
width: 895px;
border: 0px solid red;
}
#tabNav td
{
border: 0px solid blue;
padding: 0px;
vertical-align: middle;
}
#tabNav img
{
padding: 0px;
vertical-align: bottom;
}

<div id="tabNav">
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td id="MainNavigation1_tab0" align="center" valign="bottom" class="tabPos1-OffHome">
            &nbsp;</td>

        <td id="MainNavigation1_tab1" align="center" valign="top" class="tabOffHome" style="vertical-align: top;">
            <a href="ourMenu.aspx" class="navLink">
                <img id="MainNavigation1_imgOurMenu" onMouseOver="this.src='images/tabMenuOvr.gif';" onMouseOut="this.src='images/tabMenuOff.gif';" src="images/tabMenuOff.gif" style="border-width:0px;" /></a></td>

        <td id="MainNavigation1_tab1Over" valign="bottom" class="tabOverlapOffHome">
            &nbsp;</td>

        <td id="MainNavigation1_tab2" align="center" class="tabOffHome" style="vertical-align: top;">
            <a class="navLink" href="account.aspx">
                <img id="MainNavigation1_imgExpress" onMouseOver="this.src='images/tabExpressOvr.gif';" onMouseOut="this.src='images/tabExpressOff.gif';" src="images/tabExpressOff.gif" style="border-width:0px;" /></a></td>

        <td id="MainNavigation1_tab2Over" valign="bottom" class="tabOverlapOffHome2">
            &nbsp;</td>

        <td id="MainNavigation1_tab3" align="center" class="tabOff" style="vertical-align: top;">
            <a class="navLink" href="customerCenter.aspx">
                <img id="MainNavigation1_imgCustomer" onMouseOver="this.src='images/tabCustCareOvr.gif';" onMouseOut="this.src='images/tabCustCareOff.gif';" src="images/tabCustCareOff.gif" style="border-width:0px;" /></a></td>

        <td id="MainNavigation1_tab3Over" valign="bottom" class="tabOverlapOff">
            &nbsp;</td>

        <td id="MainNavigation1_tab4" align="center" class="tabOff" style="vertical-align: top;">
            <a class="navLink" href="ordering.aspx">

                <img id="MainNavigation1_img101" onMouseOver="this.src='images/tabOrder101Ovr.gif';" onMouseOut="this.src='images/tabOrder101Off.gif';" src="images/tabOrder101Off.gif" style="border-width:0px;" /></a></td>

        <td id="MainNavigation1_tab4Over" valign="bottom" class="tabOverlapOff">
            &nbsp;</td>

        <td id="MainNavigation1_tab5" align="center" class="tabOff" style="vertical-align: top;">
            <a class="navLink" href="skinnyUs.aspx">
                <img id="MainNavigation1_imgSkinny" onMouseOver="this.src='images/tabSkinnyOvr.gif';" onMouseOut="this.src='images/tabSkinnyOff.gif';" src="images/tabSkinnyOff.gif" style="border-width:0px;" /></a></td>

        <td id="MainNavigation1_tab5Over" valign="bottom" class="tabOverlapOff">

            &nbsp;</td>

        <td id="MainNavigation1_tab6" align="center" class="tabOff" style="vertical-align: top;">
            <a class="navLink" href="joinUs.aspx">
                <img id="MainNavigation1_imgJoin" onMouseOver="this.src='images/tabJoinUsOvr.gif';" onMouseOut="this.src='images/tabJoinUsOff.gif';" src="images/tabJoinUsOff.gif" style="border-width:0px;" /></a></td>

        <td id="MainNavigation1_tab6Over" valign="bottom" class="tabOverlapOff">
            &nbsp;</td>

        <td id="MainNavigation1_tab7" align="center" class="tabOff" style="padding-left: 7px; vertical-align: top;">

            <a class="navLink" href="faqs.aspx">
                <img id="MainNavigation1_imgFAQs" onMouseOver="this.src='images/tabFaqsOvr.gif';" onMouseOut="this.src='images/tabFaqsOff.gif';" src="images/tabFaqsOff.gif" style="border-width:0px;" /></a></td>

        <td id="MainNavigation1_tab7Over" align="center" class="tabPos7-Off">
            &nbsp;</td>

    </tr>
    <tr id="MainNavigation1_trLowerNav">
<td id="MainNavigation1_tdLowerNav" class="bgMenuHome-Off" colspan="15">
            <!--inner tab nav-->

            <div id="MainNavigation1_subNavHome" class="subNav">
                <br />
            </div>
4

3 回答 3

1

添加float:left#tabNav table. 在 Firefox 5 中对我来说看起来很完美。

于 2011-06-27T15:24:22.210 回答
0

您是否在文档顶部声明了 doctype?如果没有,你需要一个...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

另外,为什么要使用表格?

于 2011-06-23T22:31:06.580 回答
0

我插入了你的代码并找到了答案。您所要做的就是将以下内容添加到#tabnav id

边距:0 自动;

于 2011-06-28T04:33:57.807 回答