Reputation: 57
I have a webpage that I need to modify, the background, which is currently absolute positioned with z-index to push it back, needs to stay put when scrolling, i need to change it to fixed, yet doing so seems to break z-index and push the content below it vertically. Any ideas?
edit: OK I managed to get it to work in FF, but IE is still broken...
Upvotes: 0
Views: 7676
Reputation: 4027
Maybe look at the rules below for how elements are stacked. The Stacking order and stacking context rules below are from this link
The order of elements:
<html>
element is the only stacking context by default, but any element can be a root element for a stacking context, see rules below)
<html>
element)Upvotes: 6
Reputation: 91744
Perhaps you can put the background that is already there in a wrapper for the whole page and use the gradient background on the body instead.
Depending on the gradient, you can also try using a css3 gradient on the background of the body (or simply multiple backgrounds...) and use css3pie to make it work in IE.
Upvotes: 0
Reputation: 67194
Made a quick test. In its simplest form z-index
doesn't break when using position: fixed;
.
Upvotes: 2