Heim >Web-Frontend >HTML-Tutorial >层与层之间的位置_html/css_WEB-ITnose
<!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>
.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的,可以再帮我实现下吗?