Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-06-2012, 08:19 AM   PM User | #1
SRD75
Regular Coder

 
Join Date: Sep 2011
Posts: 121
Thanks: 23
Thanked 0 Times in 0 Posts
SRD75 is an unknown quantity at this point
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.
SRD75 is offline   Reply With Quote
Old 10-06-2012, 08:50 AM   PM User | #2
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,817
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
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.

Last edited by SB65; 10-06-2012 at 08:54 AM..
SB65 is offline   Reply With Quote
Old 10-06-2012, 08:54 AM   PM User | #3
SRD75
Regular Coder

 
Join Date: Sep 2011
Posts: 121
Thanks: 23
Thanked 0 Times in 0 Posts
SRD75 is an unknown quantity at this point
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?
SRD75 is offline   Reply With Quote
Old 10-06-2012, 09:03 AM   PM User | #4
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,817
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
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.
SB65 is offline   Reply With Quote
Old 10-06-2012, 09:52 AM   PM User | #5
coothead
Senior Coder

 
coothead's Avatar
 
Join Date: Jan 2004
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 1,551
Thanks: 0
Thanked 195 Times in 191 Posts
coothead will become famous soon enough
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.

coothead
coothead is offline   Reply With Quote
Reply

Bookmarks

Tags
background image, float

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Advertisement
Log in to turn off these ads.