Centering Layers in Dreamweaver

Posted on 2011-04-21
Medium Priority
Last Modified: 2012-05-11
I have created a website for my school.  I did not realize that it wasn't centered using different resolutions.  I tried one fix that centered my body, but my links did not work.  Now I have it back to where the links work and the body is not centered in all resolutions. The site is es.houstonisd.org/dodsones.  Please help.
Question by:tanyabsam
  • 2
  • 2
LVL 70

Accepted Solution

Jason C. Levine earned 750 total points
ID: 35446482
Hi tanyabsam,

When creating web sites, you will very rarely want to use position: absolute (AP Divs).  As you have discovered, an AP div is fixed to a coordinate on the page and doesn't center.  So what you see in Dreamweaver design view is not truly what you will see in a browser nor is it what others will see in their browsers.

To center the div change the code from:

<div id="Container" style="position:absolute; width:940px; height:1450px; z-index:-1; left: 150px; top: 11px;">


<div id="Container" style="margin:auto; width:940px; height:1450px; z-index:-1;">

margin:auto combined with any width declaration will center the block element.

LVL 30

Expert Comment

ID: 35446597
I use a container div that is the max wep page so if the browser opens maxed it goes to my container div thats 980 *760 currently and in the I just used divs inside to hold all the elements like a header left bar rignt bar and footer and make these divs float left usually and be presice about the size of the div

Author Comment

ID: 35448969

When I do that, my header (The grey bar and nav bar are not within the container anymore).  I thought if I used margin: auto on the container, everything inside can have absolute positioning.  I applied the margin auto to the container and body, but the header and nav bar are over to the left.  I thought the idea of the container was that everything would stay inside of it.
LVL 30

Expert Comment

ID: 35452944
are the floating left you must makre sure all the div's fit in it container otherwise you will get positioning errors

Author Closing Comment

ID: 35454358
I realized I had another error as well.  Although I cannot load it onto the web until Monday.  My site has been corrected.  Thanks for your help.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question