View Full Version : Positioning a layer relative to the centre of the page

02-12-2006, 09:00 PM
How do I set up a layer so that it positions itself relative to the centre of the page rather than the top left hand corner? For instance if you resize the window the layer will move to the centre of the page rather than getting cutoff.

Creative Insanity
02-12-2006, 09:31 PM
watch this (http://www.groovyjava.com/dreamweaverclub/control-tables/)

02-12-2006, 11:19 PM
Yes that is what I'm looking for but that is using tables. How do you do it using layers? Can you place a layer inside a table?

Creative Insanity
02-13-2006, 08:19 AM
Yes you can.. but I would not be the one to answer this as I am not a fan of divs, layers or what ever they are called.
The best to answer this would be Mike or RJ. I will let them answer this as mine would not help.

02-13-2006, 09:03 PM

02-14-2006, 02:17 AM
Here is the code to do what I asked. :D

<style type="text/css">
body { text-align:center; }
#wrapper { text-align:left; width:760px; margin:0 auto;position:relative; }
<div id="wrapper">
<div id="Layer1" style="position:absolute;left:100px;top:100px;border:1px
solid green; width:400px; height:150px;">

Some text content</p>

02-14-2006, 12:52 PM
If anyone else is interested in centering content like this, there' a tutorial still on the homepage: