并列三个div,
<div id="2right" style="float:right; width:150px; background-color:#000099; display:block">2right</div>
        <div id="2middle" style="float:right; width:1px; background-color:#FF3399; display:block">2m</div>
        <div id="2left" style="float:right; width:80%; background-color:#FFFF00; display:block">2left的width怎么写一下,这并列的三个div正好全屏???????????

解决方案 »

  1.   

    <div id="2right" style="float:right; width:20%; background-color:#000099; display:block">2right</div>
      

  2.   

    2right和2middle的宽是固定的px。
      

  3.   

    那只有用javascript了,判断一下当前页面的宽度,算一下就OK了
      

  4.   

    三个DIV外面套一个DIV设置width=100%
      

  5.   

    <div id="2right" style=" float:right;width:150px; background-color:#000099;">2right</div>
    <div id="2middle" style="float:right; width:1px; background-color:#FF3399 "></div>
    <div id="2left" style="width:100%; background-color:#FFFF00;">
      

  6.   

    外面建议用一个大的DIV套上……然后按楼上写法<div>
    <div id="2right" style=" float:right;width:150px; background-color:#000099;">2right</div>
    <div id="2middle" style="float:right; width:1px; background-color:#FF3399 "></div>
    <div id="2left" style="width:100%; background-color:#FFFF00;">
    </div>
      

  7.   

    老大们,请注意是并列三个div,现在设成了100%,哪个2left跑下边去了。不成,要这三个div是并列的。是这三个div用一个大div套上了
      

  8.   

    #left {
    position: absolute;
    top: 0px;
    left: 0px;
    margin: 20px;
    padding: 10px;
    border: 5px solid #666;
    background: #FFF;
    width: 150px; /* ie5win fudge begins */
    voice-family: "\"}\"";
    voice-family:inherit;
    width: 120px;
    }
    html>body #left {
    width: 120px; /* ie5win fudge ends */
    }
    #middle {
    margin: 20px 190px 20px 190px;
    padding: 10px;
    border: 5px solid #666;
    background: #FFF;
    }
    #right {
    position: absolute;
    top: 0px;
    right: 0px; /* Opera5.02 will show a space 
    at right when there is no scroll bar */
    margin: 20px;
    padding: 10px;
    border: 5px solid #666;
    background: #FFF;
    width: 150px; /* ie5win fudge begins */
    voice-family: "\"}\"";
    voice-family:inherit;
    width: 120px;
    }
    html>body right {
    width: 120px; /* ie5win fudge ends */
    }
      

  9.   

    try this
    <div id="2right" style=" float:right;width:150px; background-color:#000099;">2right</div>
    <div id="2middle" style="float:right; width:1px; background-color:#FF3399 "></div>
    <div id="2left" style="background-color:#FFFF00;">aa</div>测试过了没问题
      

  10.   

    这个你要加上float样式来控制,如果不太清楚float的意思,可以查阅相关css文档。
      

  11.   

    greatbag(快乐就是没有什么不快乐) 
    的代码没有问题,我测试过了
      

  12.   

    to koenemy() ( ) :
    先看清楚 llainn(知易行难—www.dotnetcn.net) 的代码:<div>
    <div id="2right" style=" float:right;width:150px; background-color:#000099;">2right</div>
    <div id="2middle" style="float:right; width:1px; background-color:#FF3399 "></div>
    <div id="2left" style="width:100%; background-color:#FFFF00;">
    </div>和你的有什么区别:
    <div id="2left" style="width:100%; background-color:#FFFF00;">  代码中没有  float:left 看见了?附:<div id="2left" style="width:100%; background-color:#FFFF00;"> 中的 width:100%可以不写,并且这样看起来 左列与中间列 衔接更好,如果写得话会有一些小空白。(IE6)