PDA

View Full Version : Center Alignment?


afield69
10-14-2008, 08: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.

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

afield69
10-15-2008, 12:00 PM
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.

http://img372.imageshack.us/img372/3952/pic2yj4.jpg

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

http://img76.imageshack.us/img76/7155/pic1dn7.jpg

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?

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

afield69
10-27-2008, 11: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.

<html>
<DIV align=center>
<head>
<link href="index.css" rel="stylesheet" type="text/css">
<title>darkfall</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #000000;
}
#apDiv1 {
position:absolute;
left:748px;
top:361px;
width:218px;
height:239px;
z-index:1;
text-align: center;
}
.style1 {
color: #FFFFFF;
font-family: tahoma;
}
-->
</style>
</head>
<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>
<div align="center" id="apDiv9"></div>

edbr
10-28-2008, 03: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

afield69
10-28-2008, 12:00 PM
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.