4 replies [Last post]
florent
florent's picture
Offline
Enthusiast
Paris, France
Last seen: 13 years 37 weeks ago
Paris, France
Timezone: GMT+1
Joined: 2003-04-19
Posts: 96
Points: 0

hi again,

one of my friends is trying to make a website and he has a css problem on the first page he made ! and i can't help him !

look at : http://tomekmusic.free.fr/test/

what he wants is the menu div (black background and olive border in top left) to overlap the content div (main div with the background image)

is there any way to force the black background of the menu div to overlap the background image of the content div ?

thanks !

I'm a perfectionist
and perfect is a skinned knee

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 3 days 7 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

my friend's site

Hi florent,
You could position the menu and set a z-index to get the menu above the content.

Hope that helps

florent
florent's picture
Offline
Enthusiast
Paris, France
Last seen: 13 years 37 weeks ago
Paris, France
Timezone: GMT+1
Joined: 2003-04-19
Posts: 96
Points: 0

my friend's site

hi tony, thanks for your input !

i've tried giving the menu "z-index : 1" but it doesn't work...

what do you mean by "position the menu" ? set a "position : absolute" or something ?

I'm a perfectionist
and perfect is a skinned knee

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 3 days 7 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

my friend's site

Hi Florent,
for z-index to work correctly you need to position the element either absolutely or relative.
Every positioned item has a z-index set by the browser, all positioned elements are above non-positioned elements and are given a stacking order by the order they are defined in the html.

If you set main, content and menu to position:relative; and give menu a higher z-index then content, you should get close to what you are after.

Hope that helps

florent
florent's picture
Offline
Enthusiast
Paris, France
Last seen: 13 years 37 weeks ago
Paris, France
Timezone: GMT+1
Joined: 2003-04-19
Posts: 96
Points: 0

my friend's site

thanks very much tony, that works perfectly ! Tongue

:oops: i didn't know that thing about z-index and position being "tied" together... :roll:

I'm a perfectionist
and perfect is a skinned knee