3 Replies Latest reply on Jul 10, 2008 9:45 AM by cynthiabancale

    Centering an existing website

    cynthiabancale
      Hi Everyone. I completed a website a few months ago without using a template. The site is fixed width and flush left (expands to right). Now the client wants the site to "float" as a fixed width still, but centered on the middle of the page. I'm not sure the best way to convert this file to the format he now wants. Plus I'm guessing the fact that I didn't use a template to begin with is going to make this a bigger task. Thanks in advance!
        • 1. Re: Centering an existing website
          Level 7
          It isn't difficult at all, really.

          You can house your entire "page" within a #wrapper div. Make sure you
          give that div a fixed width (whatever your page size is). Then, you can
          give that div left and right margins of auto. That will center it in
          the browser.

          #wrapper {
          width: 800px; (or whatever your width is)
          margin: 0 auto;
          }

          Put all your content within #wrapper.

          <body>
          <div id="wrapper">
          All your content goes here.
          </div> <!--end #wrapper-->
          </body>

          --

          Virginia Carter
          Carolina Web Creations
          ======================
          www.carolinawebcreations.biz

          cynthiabancale wrote:
          > Hi Everyone. I completed a website a few months ago without using a template.
          > The site is fixed width and flush left (expands to right). Now the client wants
          > the site to "float" as a fixed width still, but centered on the middle of the
          > page. I'm not sure the best way to convert this file to the format he now
          > wants. Plus I'm guessing the fact that I didn't use a template to begin with is
          > going to make this a bigger task. Thanks in advance!
          >
          • 2. Re: Centering an existing website
            Level 7
            Do what Virginia said. Then put the CSS rule she gave you in your external
            style sheet. Then on every page select everything between the <body></body>
            tags (in Code view). Using the DW menu: Insert > Layout Objects > Div tag.
            In the Insert Div Tag dialog box be sure Insert is set to "Wrap around
            selection". Select "wrapper" for the ID setting.

            You could also do this using Find & Replace on the <body></body> tags but
            the method I set out is less error prone.

            Oh yeah, back up the site before you start. :-)

            --

            Walt


            "cynthiabancale" <webforumsuser@macromedia.com> wrote in message
            news:g53hl5$co9$1@forums.macromedia.com...
            > Hi Everyone. I completed a website a few months ago without using a
            > template.
            > The site is fixed width and flush left (expands to right). Now the client
            > wants
            > the site to "float" as a fixed width still, but centered on the middle of
            > the
            > page. I'm not sure the best way to convert this file to the format he now
            > wants. Plus I'm guessing the fact that I didn't use a template to begin
            > with is
            > going to make this a bigger task. Thanks in advance!
            >


            • 3. Re: Centering an existing website
              cynthiabancale Level 1
              Thanks Virginia and Walt....I will give this a try. This was my first site, so it all seems like a challenge! I really appreciate your help.
              Cynthia