[問題] CSS z-index 怪怪

看板Web_Design作者 (人是不你)時間16年前 (2009/11/21 19:21), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
<html> <head> <title>XD</title> <style> .outer { width:100px; height:100px; background:#00ff00; z-index:1; position:absolute; top:0px; left:0px; } .outer:hover { z-index:-1; } .inner { width:100px; height:100px; background:#0000ff; z-index:0; position:absolute; top:0px; left:0px; } .inner:hover { z-index:2; } </style> </head> <body> <div class="outer"></div><div class="inner"></div> </body> </html> 剛剛用很笨的方法寫的 無法達成預期 讓藍色區塊浮出 懇請各位高手指教 m(_ _)m -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.43.3.220

11/21 23:23, , 1F
outer把inner遮住了 無法觸發hover
11/21 23:23, 1F

11/21 23:32, , 2F
正確的原因應該是div不支援hover 才對
11/21 23:32, 2F
文章代碼(AID): #1B1yqcZi (Web_Design)