左右两列布局。右侧自适应.当右侧插入table,设置width:100%时。在ie6下会撐开表格,代码:

<style type="text/css">
        body{margin:0;padding:0}
        #left{width:150px;float:left;background:#ff0000;height:200px;}
        #right{margin-left:160px;background:blue}
        table{width:100%;}
    </style>

 

<body>
    <div id="left">这是左边</div>
    <div id="right">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <td>a</td>
                <td> d</td>
            </tr>
        </table>
    </div>
</body>

 

解决方法

左侧采用绝对定位:position:absolute;然后设置left.top.bottom.right值

posted @ 2010-06-15 15:53 沉默杨仔 阅读(145) 评论(0) 编辑

提取自discuz并做了一些小修改.

$(document).ready(function setscreendiv() {
    var clientHeight = 768;
    var clientWidth=600;
    var iframe = document.getElementById("main");
    if (navigator.userAgent.toLowerCase().indexOf('opera') != -1) {
        clientHeight = document.documentElement.clientHeight + 190;
        clientWidth = document.documentElement.clientWidth - 180;
    }
    else {
        clientHeight = document.documentElement.clientHeight - 55;
        clientWidth=document.documentElement.clientWidth-180;
    }
    iframe.style.height = clientHeight + 'px';
    iframe.style.width=clientWidth+'px';
    document.documentElement.style.overflow = "hidden";
    window.onresize = function () { setscreendiv(); }
    window.onscroll = function () { setscreendiv(); }
}
)

ps:框架实在难以驾驭,目前项目后台已不采用框架方式。

posted @ 2010-06-15 09:20 沉默杨仔 阅读(222) 评论(0) 编辑