可以根个人情况设置z-index的值
1->position 为absolute的情况
<html> <head> <style> #p1{position:absolute;width:300px;height:300px;background:#ccc;} #p2{position:absolute;left:0;top:0;width:200px;height:200px;background:red;filter:alpha(opacity=50);} </style> </head> <body> <pid="p1">这里是p1的内容 <pid="p2"></p> </p> </body> </html>
2->用margin为负的操作
<html> <head> <style> #p1 {position:relative; width:300px; height:300px;background:#ccc;} #p2 {position:relative; left:0; top:0;margin-top:-15px;width:200px; height:200px; background:red;filter:alpha(opacity=50);} </style> </head> <body> <pid="p1"> 这里是p1的内容 <pid="p2"></p> </p> </body> </html>