Forums
This topic is locked
How do I center a layer?
Replies
Replied 01 Aug 2008 15:37:30
01 Aug 2008 15:37:30 Miroslav Zografski replied:
Hi Josh,
if you really hang on on absolute positioning, then the story becomes too compicated. Here is centered div with absolute positioning:
<pre id=code><font face=courier size=2 id=code>
<div style="position:absolute;width:100%;left:0;">
<div style="width:200px;margin:10px auto">Content for New Div Tag Goes Here
</div>
</div>
</font id=code></pre id=code>
in this code you have a centered relative positioned div inside a container - absolute positioned div. In this case you have your content centered, but the draw back is that container has width =100% and overlaps, in this case entier row.
If you dont mind a relatively positioned div the only thing you need to care is it's container.
Regards,
M.Zografski
-----------------------------------
DMXZone.com Support Team
-----------------------------------
if you really hang on on absolute positioning, then the story becomes too compicated. Here is centered div with absolute positioning:
<pre id=code><font face=courier size=2 id=code>
<div style="position:absolute;width:100%;left:0;">
<div style="width:200px;margin:10px auto">Content for New Div Tag Goes Here
</div>
</div>
</font id=code></pre id=code>
in this code you have a centered relative positioned div inside a container - absolute positioned div. In this case you have your content centered, but the draw back is that container has width =100% and overlaps, in this case entier row.
If you dont mind a relatively positioned div the only thing you need to care is it's container.
Regards,
M.Zografski
-----------------------------------
DMXZone.com Support Team
-----------------------------------