<tr>
<th width="200">
<div id="id_chQueryTh" class="frontTh" onclick="changeTable('query');" style="float:left;width:100;">
查询。。件</div>
<div id="id_chListTh" class="behindTh" onclick="changeTable('list');" style="float:right;width:100;">
显示结果</div>
</th>
<td width="600" align="right">
<div style="position: absolute; left: 212px; top: 20px; width: 600px;border-bottom:1px #000000 solid;">
。。事项综合查询</div>
</td>
</tr>
有谁能告诉我怎样在FF下让这两个DIV同行显示吗?试了N种方法总是出问题,IE下正常但FF下第二个DIV会在第二行显示

解决方案 »

  1.   

    2个div如果不设置100呢,小一点呢
      

  2.   

    如果对CSS不是很熟悉,对宽度的设置不要不留余地。
      

  3.   

    试试: table ,th,td{padding:0px}
      

  4.   

    我这里ff是正常显示的,你可以给这两个div加到一个div里面,这样就好调试了
      

  5.   

    文档声明
    浮动
    div包含table
    堆积木
      

  6.   

    lz使用positin意欲何在:
    position: absolute; left: 212px; top: 20px(可以的话去掉吧)
      

  7.   

    to:yangyihan1,第三个DIV是在另外一个td里的
    to:hch126163,试过了,pad都设为了0
    to:hnxxwyq,因为TH的宽度是200,所以每个DIV都设为了100
    to:LXH060204,是想画一根线,恰好和两个DIV连起来,我是想不用背景图片实现换页效果
    to:jinfengyiye,嗯,我也试了,如果不加上class的话就能同行,但是我想通过在点击的时候变动DIV的CLASS来实现换页效果
    另外贴上我的class给大家看看,我把原来放在div上的style全部放到了class里,但还是不行...
    .frontTh{
    color:#000000;
    margin-bottom:1px;
    display:block;
    padding-left:0px;
    padding-right:0px;
    padding-top:0px;
    background-color:#ffffff;
    text-decoration: none;
    line-height:20px;
    width:100px;
    float:left;
    border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-top-width:1px; border-top-style:solid; border-bottom-width:1px
    }
    .behindTh{
    color:#bfbfbf;
    margin-bottom:1px;
    display:block;
    padding-left:0px;
    padding-right:0px;
    padding-top:0px;
    border-bottom:1px #000000 solid;
    background-color:#e9e9e9;
    text-decoration: none;
    line-height:20px;
    width:100px;
    float:left;
    }
    不知道怎么回事,IE里一切正常,FF里怎么搞都会变两行,郁闷,有没有高人解决过这个问题呢
      

  8.   

    虽然IE被骂得很臭
    但至少在我们公司,还有90%以上的人在用IE6,少数用IE7或IE8
    没一个用FF的
    唉,所以做东西,还得以IE6为标准
      

  9.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
     <head>
      <title> New Document </title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style type="text/css">
    .frontTh{
    color:#000000;
    margin-bottom:1px;
    display:block;
    padding-left:0px;
    padding-right:0px;
    padding-top:0px;
    background-color:#ffffff;
    text-decoration: none;
    line-height:20px;
    width:100px;
    float:left;
    /*你这里的设置了div的border左右各1px,那么在ff中这个div的宽度就是102px*/
    border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-top-width:1px; border-top-style:solid; border-bottom-width:1px
    }
    .behindTh{
    color:#bfbfbf;
    margin-bottom:1px;
    display:block;
    padding-left:0px;
    padding-right:0px;
    padding-top:0px;
    border-bottom:1px #000000 solid;
    background-color:#e9e9e9;
    text-decoration: none;
    line-height:20px;
    width:100px;
    float:left;
    }

    </style>
     </head>
    <body>
    <table>
    <tr>
    <!--这里改为202px-->
    <th width="202">
    <div id="id_chQueryTh" class="frontTh" onclick="changeTable('query');" style="float:left;width:100;">
    查询。。件
    </div>
    <div id="id_chListTh" class="behindTh" onclick="changeTable('list');" style="float:right;width:100;">
    显示结果
    </div>
    </th>
    <td width="600" align="right">
    <div style="position: absolute; left: 212px; top: 20px; width: 600px;border-bottom:1px #000000 solid;">
    。。事项综合查询</div>
    </td>
    </tr>
     
    </table>
    </body>
    </html>
      

  10.   

    to:hnxxwyq 刚刚改了,但还是不行,而且我把代码单独切出测试,发现可以同行显示...,放在完整的页面中又出问题,我仔细检查了一下css中的所有样式,应该没有冲突,而且我的div也没有嵌套在其他样式中,算了,不改了,FF实在是难搞,不知道是不是BUG
      

  11.   

    OH,MY GOD,终于找到问题原因了...,就是hnxxwyq老兄说的原因,不过要改成width:204px,天,真的隐蔽,要一个个的算宽度
    谢谢各位的捧场
      

  12.   


    .frontTh{
    color:#000000;
    margin-bottom:1px;
    display:block;
    padding-left:0px;
    padding-right:0px;
    padding-top:0px;
    background-color:#ffffff;
    text-decoration: none;
    line-height:20px;
    width:100px;
    float:left;/* 你这里设置的border左右各1px,那么div的实际宽度是102(ff中)*/
    border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1px; border-top-width:1px; border-top-style:solid; border-bottom-width:1px
    }