IE6:绝对定位元素的宽度:100%仅延伸到未定位的父级宽度

时间:2013-03-31 08:27:23

标签: css position internet-explorer-6 css-position percentage

抱歉我的英文。 这可能是一个太简单的问题,但我在搜索结果中找不到答案:( 我想把DIV伸展到完整的窗口,在其他小DIV中。 它适用于所有现代浏览器,但IE6。 我通常不支持IE6,但我的客户要求它。 代码在

之下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko" >
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

        <style type="text/css">
        #outter {
            height: 200px;
            width: 200px;
            background: #00f;
            margin:0 auto;
        }
        #inner {
            background: #f00;
            position: absolute;
            width: 100%;
            height: 100%;
            top: 20px;
            left: 100px;
        }
        </style>
    </head>

    <body>
        <div id="outter">
            <div id="inner">
            </div>
        </div>
    </body>
</html>

0 个答案:

没有答案