5,006
社区成员
发帖
与我相关
我的任务
分享
<style type="text/css">
body {
margin: 30px;
}
a {
color: blue;
}
a:hover {
color: red;
}
</style>
<div>
<a href="javascript:void(0);"
onmouseover="this.style.backgroundColor='yellow'"
onmouseout="this.style.backgroundColor='transparent'">
please put your mouse on
</a>
<div style="height:20px; width:190px; margin-top:10px; background-color:blue;"
onmouseover="this.style.backgroundColor='red'"
onmouseout="this.style.backgroundColor='blue'"></div>
<div style="background-color:transparent;position:absolute;left:10%;top:23px;
border:10px solid green;width:100px;height:80px;"></div>
</div>
大家可以自行实验一下,点一下被绿色的框筐套住的文字 和 那段蓝色的 DIV。看看IE的神奇之处。<style type="text/css">
body{margin:0;}
a{color:blue;}
a:hover{color:red;}
</style>
<div style="position:relative;margin:50px;width:300px;">
<a href="javascript:void(0);"
onmouseover="this.style.backgroundColor='yellow'"
onmouseout="this.style.backgroundColor='transparent'">
please put your mouse on
</a>
<div style="height:20px; width:190px; margin-top:10px; background-color:blue;"
onmouseover="this.style.backgroundColor='red'"
onmouseout="this.style.backgroundColor='blue'"></div>
<div style="opacity:0;filter:alpha(opacity=0);background-color:green;
position:absolute;left:10%;top:-23px;
border:10px solid green;width:100px;height:80px;"></div>
</div>
这时候,整个元素透明了,所以,连border也看不到了。各位同学可以自己点点看,被遮盖的分界处在 please 的a和s之间。