可以根個人情況設置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>
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com