日期:2014-05-17  浏览次数:20551 次

层与层之间的位置
HTML code

<!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" >
<head>
    <title>Untitled Page</title>
    <style type="text/css">
        body { font-family: 宋体, Arial; color: #000; background-color: #ffffff; }
        * { margin: 0; padding: 0; font-size: 12px; }
        
        
        .wrap { width: 298px; border: solid 1px #ccc; margin: 50px 0 0 30px; }
        .wrap .content { margin: 6px; }
        .wrap .row { height: 30px; padding-left: 20px; cursor: pointer; }
        .wrap a { line-height: 30px; }
        .wrap a.out-title { color: #313131; text-decoration: none; }
        .wrap a.out-title:hover { color: #f00; text-decoration: underline; font-weight: bold; }
        
        .wrap .active-row { height: 28px; line-height: 28px; border: solid 1px #eee; border-right: none; }
        .wrap .active-row a { font-weight: bold; }
        
        .wrap .inside-wrap { z-index: 100; background-color: #fff; height: 100px; width:204px; border: solid 1px #eee; display: none; position: absolute; left: 200px; margin-top: -31px; }
        .wrap .active-row .inside-wrap { display: block; }
    </style>
</head>
<body>
    <div class="wrap">
        <div class="content">
            <div class="row" onmouseover="this.className='row active-row'" onmouseout="this.className='row'">
                <a href="javascript:void(0);" class="out-title">笔记本电脑</a>
                <div class="inside-wrap">
                    里面内容
                </div>
            </div>
            <div class="row" onmouseover="this.className='row active-row'" onmouseout="this.className='row'">
                <a href="javascript:void(0);" class="out-title">笔记本电脑</a>
                <div class="inside-wrap">
                    里面内容
                </div>
            </div>
        </div>
    </div>
</body>
</html>



我鼠标移上去的时候,class为inside-wrap这块内容的相对位置,在IE8,firefox下是正常的,在ie6,7下就不正常
y轴不在同一水平线,请问css怎么写才能解决呢,搞了半天,搞不出来,请大侠帮忙
附加:如果上面的问题解决了,如果在class为inside-wrap这块下面铺一层iframe怎么实现呢

------解决方案--------------------
.wrap .row {
height: 30px;
padding-left: 20px;
cursor: pointer;
position:relative;
}


.wrap .inside-wrap {
z-index: 100;
background-color: #fff;
height: 100px;
width:204px;
border: solid 1px #eee;
display:none;
position: absolute;
left: 200px; top:0;

}

这样就好了!
------解决方案--------------------
探讨

.wrap .row {
height: 30px;
padding-left: 20px;
cursor: pointer;
position:relative;
}


.wrap .inside-wrap {
z-index: 100;
background-color: #fff;
height: 100px;
width:204px;
border: soli……

------解决方案--------------------
探讨

.wrap .row {
height: 30px;
padding-left: 20px;
cursor: pointer;
position:relative;
}


.wrap .inside-wrap {
z-index: 100;
background-color: #fff;
height: 100px;
width:204px;
border: soli……

------解决方案--------------------

顶1楼的答案!!