代码之家  ›  专栏  ›  技术社区  ›  eemceebee

css中的网站标题有问题

  •  0
  • eemceebee  · 技术社区  · 16 年前

    我目前正在重建一个网站,使用一个表格布局,并希望它与图层和css。

    我的问题是头球。标题当前是一个具有3个单元格的100%宽度的表。

    [左边框][徽标800像素][右边框]

    <table border="0" width="100%" height="600" cellpadding="0" cellspacing="0">
      <tr>
        <td background="images/background_left.jpg">&nbsp;</td>
        <td width="800" valign="top">the header content</td>
        <td background="images/background_right.jpg">&nbsp;</td>
      </tr>
    </table>
    

    中间的单元格,logo横幅,应该总是800px。左单元格和右单元格的背景与logoBanner的结尾匹配。

    现在的问题是如何用css解决这个问题?

    谢谢

    1 回复  |  直到 16 年前
        1
  •  1
  •   Rigobert Song    16 年前

    试试这个 Html:

    <div id="header">
       <div id="left">
          <div id="leftFrame"></div>
          <div id="center"></div>
       </div>
       <div id="right"></div>
    </div>
    

    CSS:

    #header{
     width:100%;
     height:600px;
    }
    #left{
     width:66%;
     float:left;
    }
    #right{
     float:right;
    }
    #center{
     width:800px;
     float:right;
    }
    #leftFrame{
     float:left;
    }
    

    没有测试,但希望这能有帮助