Centering Layers in Dreamweaver

Posted on 2011-04-21
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  Please help.
Question by:tanyabsam
    LVL 70

    Accepted Solution

    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

    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


    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

    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

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    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…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    794 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now