View Full Version : Center Alignment?

10-14-2008, 07:58 PM
Hello there!

I'm slowly getting to grips with Dreamweaver (CS3), my templates looking great and the content is mounting. I've run into a small hitch, well i hope it's small. I've managed to align my template to the center using the <DIV align=center> code, all was well until i noticed my DIV's i have created haven't stuck with the template so to speak. On the DW design window the DIV's are in the correct place, so I've tried centering them to but still no luck. Have i done something incorrectly? Any help is greatly appreciated.

10-14-2008, 10:01 PM
Do you have a test url we can look at?

10-15-2008, 11:00 AM
Do you have a test url we can look at?

Hey there, i don't have a test URL. However i can show you what i mean through the pictures below.


The first picture is what the DIV look's like in Dreamweaver, nicely aligned and in the correct place.


Second picture, as you can see the text is not in the correct place although it's apparently "Centered" along with the template. The only thing I've been able to do so far is drag the DIV to the right hand side of my template until it's in the correct place upon preview, but this is starting to get confusing when editing other DIV's. Is this the only solution?

10-16-2008, 12:59 AM
your code would be more use than screenshots

10-27-2008, 10:39 PM
your code would be more use than screenshots

I am extremely sorry for the delayed reply, I've been terribly busy! The code is below, knowing my luck I've missed something, or I'm going about it the completely wrong way. Any help is greatly appreciated.

<DIV align=center>
<link href="index.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
background-color: #000000;
#apDiv1 {
text-align: center;
.style1 {
color: #FFFFFF;
font-family: tahoma;
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" tracingsrc="images/darkfall_59.jpg" tracingopacity="100" tracingx="741" tracingy="348">
<!-- ImageReady Slices (darkfall.psd) -->
<div id="apDiv1">
<pre class="style1"> .: Latest Announcements :.</pre>
<div align="center" id="apDiv9"></div>

10-28-2008, 02:30 AM
there is no definition for
<div align="center" id="apDiv9"></div>
create a division relative not absolute positioning centre it in your style

10-28-2008, 11:00 AM
I used the following code:

<div style="width:100%"> <!-- create container div -->
<div style="position:relative; width:950px; margin:0 auto;"> <!-- center inner div within the container div -->

I'm trying not to use position "absolute", I'm now becoming slightly confused and frustrated. The whole body of my site is now nicely in cased in an "envelope" so to speak, and the only thing I've achieved is a gap between the website layout and browser window which has made it look odd.