Fixed div always on top

hey im having a problem with my header which is fixed to the top of the browser but as i scoll down it goes behind videos which i embed but remains on top of everything else. How do i get it to ALWAYS stay visible?? Please help!!

You can use z-index if the other divs are absolutely positioned. Other than that, you have to place the div in the HTML either before everything or after (I forget which :()

i am using wordpress and the videos are embedded into posts… which are contained in <object> tags and if i set them to absolute it ruins the whole layout. So z-index isnt helping because i cant set object to absolute without ruining the layout. is there another way??

Set the position to relative instead of absolute. It’ll allow you to use z-index. So something like this will work:


#header {
     position: relative;
     z-index: 2;
}

Are the videos .swf files? - if so, set their wmode parameter to “transparent”.

Set the position to relative instead of absolute. It’ll allow you to use z-index.

A position setting of relative, fixed or absolute allows you to use z-index.

Do you have a link to the page in question?

Right, but he was saying absolute positioning broke his design while under the assumption that in order to use z-index he needed his positioning to be absolute.

As already mentioned above you need to control the z-index which can be done by adding position:relative is the element is non-positioned.

However as Centauri said this will not be enough of the elements are flash files etc and then you would need to set their wmode parameter to “transparent”. There is a sticky in the flash forum that explains it.

hey thanks alot totally helped