I am trying to get my footer to show on top of the footer background, but z-index seems not to be working. Does anyone see what is wrong with it? http://jsfiddle.net/f2ySC/
相关问题
- Adding a timeout to a render function in ReactJS
-
Why does the box-shadow property not apply to a
- Add animation to jQuery function Interval
- jQuery hover to slide?
- Issue with star rating css
You have to explicitly define the
position
property:http://jsfiddle.net/f2ySC/1/
This brings the footer into the
current stacking context
:http://www.w3.org/TR/CSS2/visuren.html#z-index
using negative margin is not a good practice. z-index:-1; works it just display the content on the background of another div :)
On footerBox set the
position
attribute toabsolute
Your new code should read as followsSee a demo here
Using
position: relative
also worksIs this the effect you are looking for? Updated example
I added
position: relative;
to#footerBack
and.footerBox
to enablez-index