首页 >web前端 >html教程 >层与层之间的位置_html/css_WEB-ITnose

层与层之间的位置_html/css_WEB-ITnose

WBOY
WBOY原创
2016-06-21 09:33:491175浏览

<!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……
+11

如果下面加个ifame的,可以再帮我实现下吗?

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn