【问题标题】:Problem with website header in CSSCSS中的网站标题问题
【发布时间】:2010-05-05 17:20:22
【问题描述】:

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

我遇到的问题是标题。标题当前是一个 100% 宽度的表格,包含 3 个单元格。

[左边框][logo 800px][右边框]

<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>

中心单元格,即徽标横幅,应始终为 800 像素。左右单元格的背景与徽标横幅的末端相匹配。

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

谢谢

【问题讨论】:

    标签: css html


    【解决方案1】:

    试试这个 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;
    }
    

    未测试,但希望对您有所帮助

    【讨论】:

      猜你喜欢
      • 2013-03-23
      • 2017-08-27
      • 1970-01-01
      • 2021-06-17
      • 2014-03-20
      • 1970-01-01
      • 1970-01-01
      • 2021-12-11
      • 1970-01-01
      相关资源
      最近更新 更多