两边固定中间自适应的布局

<div >
    <div >
    </div>
    <div >
    </div>
    <div >
    </div>
</div>

  

CSS:

<style type="text/css">
    body
    {
        margin: 0px;
    }
        
    #main
    {
        background-color: #006699; 
        height: 500px;
    }
        
    /* 左列,默认的宽度是200 Pixel */
    #left
    {
        float: left;
        width: 200px;
        height: 300px;
        background-color: #33CC33;
        z-index: 3;
    }
        
    /* 右列,默认的宽度是200 Pixel */
    #right
    {
        float: right;
        width: 200px;
        height: 300px;
        background-color: #999999;
        z-index: 5;
    }
        
    /* 居中自适应 */
    #mid
    {
        width: auto;
        height: 300px;
        margin: 0 210px;
        background-color: #999900;
        z-index: 1;
    }
</style>

 

整体效果:

两边固定中间子适应的流式布局

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-06-07
  • 2022-02-09
  • 2021-07-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2021-08-09
  • 2021-06-06
  • 2022-03-03
相关资源
相似解决方案