• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[HTML] : centered layers

#1
I'm writing a page in which there are two layers over top of one another (a swf in one, an image behind it in another). I would like to have the layers be centered in any resolution, rather than just writing it for basic 1024x768, but with my not-so-great knowledge of HTML, I dont know how to go about it. I searched through HTML forums/tutorial sites, and couldn't find anything, possibly because I'm blind.

Any pointing in the right direction/suggestions/directions would be greatly appreciated, thanks.
 
#4
I played with an insane amount of things to try and get this to work, and I finally reached a point of success with "style="margin-left: auto; margin-right: auto;" in the layer's tag. This, for one reason or another, wouldn't work with two or more layers... they would be centered, but wouldn't be over top of one another anymore. No big deal, I just made the shadow part of the swf, and placed it in one centered layer - less chance of there being a code mishap when the page is rendered that way anyway.

Thank you for the help, sirs.
 
#5
keep the margin-left and margin-right for each of them they will keep it centered if you set a width for each section as well
to make the layers overlay you will need to set the z-index. put a z-index of 0 for the bottom layer and a z-index of 1 or greater for the top layer, that should work
 
#6
yeah, it was odd like that - I had the z-index' set for each (0 and 1), and the layering had worked before I put the margin-left/right in the tag. After the change, the two layers would show up in the page one after the other, the second layer using the "margin-top=" or "top:" pixel number as the space between the first layer and the second, rather than from the top of the page. Odd, yes?
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,014
Latest member
sanoravies