07 март, 2010

Overlapping And Z-Index

Това е за сведение, когато следващия път отново изгубя половин час в чудене защо третото ниво на CSS-менюто излиза над второто, при положение че им слагам z-index.

"When you apply z-index to a positioned element, you do two things.

First, you say that the element is in front or behind other elements that share the same stacking context. This is what we normally think about when we change z-index -- we want something to move in front or in back of something else.

Second, you create a new stacking context for anything inside the positioned element. Once you've created a stacking context, any layering that happens inside that stacking context stays in that context. This is the part we forget."

http://css-discuss.incutio.com/?page=OverlappingAndZIndex


Ето защо в случая се налага да използваме някой друг подход.

Няма коментари: