日期:2014-05-16 浏览次数:20430 次
function showdiv() { document.getelementById("b").style.display='block'; document.getelementById("a").style.border="1px solid red"; //两个div相交,怎样把相交处的border去掉 就像京东网的[url=http://www.360buy.com/]http://www.360buy.com/[/url] 左边的菜单一样 } <div id="a" onmouseover="showdiv()"> </div> <div id="b"> </div>
<style> .a { width:60px; height:40px; border:1px solid red; border-right:none; background:#eee; position:absolute; z-index:1; top:50px;} .b { width:120px; height:120px; border:1px solid red; position:absolute; left:50px; top:10px; background:#eee; position:absolute; left:68px; top:10px;} </style> <div class="a"></div> <div class="b"></div>
------解决方案--------------------
你的demo根本就跑不起来
------解决方案--------------------
你设置一个div的z-index属性大于另外一个不就行了
------解决方案--------------------
<!DOCTYPE HTML> <html> <head> <style type="text/css"> .wrap{ position:relative; } .left{ position:absolute; border:1px solid #C40000; border-right:0px; background:#FEF8EF; line-height:26px; width:100px; z-index:2; } .right{ position:absolute; left:100px; top:0px; border:1px solid #C40000; background:#FEF8EF; width:200px; height:300px; z-index:1; } </style> </head> <body> <div class="wrap"> <div class="left">left</div> <div class="right">right</div> </div> </body> </html>