CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   HTML & CSS (http://www.codingforums.com/forumdisplay.php?f=13)
-   -   background image to overlay other layers (http://www.codingforums.com/showthread.php?t=275446)

SRD75 10-06-2012 08:19 AM

background image to overlay other layers
 
Hi. On this website, I need the layer with bunting to display over the top of all other layers. (bunting is the line of flags)

I want this to happen without the bunting layer pushing other layers down.

i.e. I want the layer to 'float' above all others.

How can I do this?

I tried using z-index but this has not worked.

SB65 10-06-2012 08:50 AM

The div #bunting includes all the login links etc, and has the background image. Try making the css:

Code:

#bunting {
    background: url("/image/bunting.png") no-repeat scroll 0 0 transparent;
    /*height: 61px;*/
    margin: 0 auto;
    position: relative;
    width: 880px;
    /*z-index: 9999;*/
  padding-top:61px

}

z-index isn't going to make any difference because #bunting contains all the elements you're trying to rearrange. Giving the element padding-top pushes the content down without changing the position of the background, and setting no-repeat means the image will only show once.

EDIT: Reading your post again I'm not quite certain that's the effect you want...if you just want the bunting to be on top of #container then you need to rearrange your html so #bunting doesn't include #container. Then you can use z-index to position it on top of #container.

SRD75 10-06-2012 08:54 AM

Thanks.

That is an improvement.

However, maybe I shouldn't be using a background image. I'd like the bunting to overlay everything else. Like this.

Is this possible?

SB65 10-06-2012 09:03 AM

Yes, although see my edit for an alternate option which might be what you want. You can use position:absolute to position either a layer with a background image (or just the image itself) on top of any element. Again this will mean amending your html to move #container out of #bunting.

coothead 10-06-2012 09:52 AM

Hi there SRD75,
Quote:

I'd like the bunting to overlay everything else.
You should bear in mind, though, that positioning anything above links or forms will make them inoperable. :eek:

coothead


All times are GMT +1. The time now is 06:37 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.