Forums
This topic is locked
Centering layers
18 Jul 2007 12:21:51 Dominic R posted:
I have a layer in my page that is aligned to the top and left, this means in different resolutions it moves in relation to other centered items on the page. Is there any way to center a layer?The code i currently have for the layer is
<div id="Layer1" style="position:absolute; left:39px; top:29px; width:691px; height:126px; z-index:1"></div>
How should this be edited to get the desired affect?
Replies
Replied 26 Jul 2007 17:15:02
26 Jul 2007 17:15:02 ball 420 replied:
<center> <div id="Layer1" style="position:absolute; left:39px; top:29px; width:691px; height:126px; z-index:1"></div></center>
i don't know if that helps... i would have to see all your code
i don't know if that helps... i would have to see all your code
Replied 11 Aug 2007 00:36:19
11 Aug 2007 00:36:19 Koreen Corbett replied:
Do this...create a table for layout purposes. Insert the layer (<div> tag) in a cell in the table. Set position:relative; top:0px; left:0px. That should do it. If you are going to have additional layers show/hide upon clicks, nest each additional layer inside of the original layer and set position:absolute; top:0px; left:0px.
Hope that helps.
Hope that helps.