Inset box-shadow beneath content scroll fix
问题 I found this solution Inset box-shadow beneath content which works just fine, but when the outer container div has to be scrolling (overflow), the inner div which has the box-shadow will scroll with the content. How to fix this? div { height:300px; color:red; position:relative; } div div { box-shadow:inset 0 0 10px black; position:absolute; top:0; left:0; width:100%; height:100%; } <div> <div></div> a </div> 回答1: you can consider adding an overlay and use z-index to specify which block is on