tags:

views:

168

answers:

3

Hello everyone!

I'm new to this site and thought I might give it a shot. I've been having a problem for quite some time now but as my project evolved other problems was solved, but this has remained. And finding the right thing wasn't easy. Im not even sure what the term is for this kind of thing.

Anyway, I want a background image to the right and left of my main page. It need to be z-indexed below the actual page(incase people with low resolutions view the page) so that it doesn't extend over the main page and makes the content unreadable. It needs to go below the actual page if low resolutions are used.

I've been using the following code to do the work for me right now:

<img style="position: absolute; top: 120px; left: 10px; width: 121px; height: 443px; z-index: -1;" src="../admin/images/background_text.png">

Problem is that this isn't working to good with older versions of IE for example and in some cases not at all in others. As you can see it has a set position on my page(left side its higher up on the page) which is also something I want to achieve.

I hope I explained this good enough and cheers to this site. Seems like a great place to find solutions.

Cheers, Martin.

A: 

Im not sure if i understand your question or not.

Anyway. Dont set your z-index on the image. I would set position relative on the layers that needed to be at the top.

Remember that IE6 dont get the z-index. It figures out which comes first and then its the last one that is on top, even though it haves a lower z-index.

designer
Check out http://www.capiachi.com/betaSorry for being missinformant. Im actually trying to add 2 images with a specific size to the left and right. I want them to work exactly like they work in the latest firefox.
+1  A: 

Try this:

<body style="background: url('../admin/images/background_text.png') 120px 10px;" > rest of the page...

this sets the background for the whole page (what it seems kind of like you're doing?) to the given image.

I would also size your image to the desired size if it isn't already, then you don't need to supply width and height (or worry about IE rendering the resize).

if you're really just putting it on the side, I might use a table or div setup and set the background on that (not knowing how your page is setup).

CodePartizan
A: 

Here's an improved answer for you:

Give your "wrapper" div the background image as described before. Then extend your main table all the way to the right (or wrap it in another table or div with 100% width) and give that the right side background image. Then the images are still behind all the content and they both should behave as you want them to.

if you need more info on the background css attribute, check out the WDG page

CodePartizan
That should work, great idea! Thanks! Ill get back once i try it out!