Centering a Website??????

by nmh
6 replies
  • WEB DESIGN
  • |
Hi All,

Ok, here's the scoop! I FINALLY found a template I can alter to use for a website BUT when I uploaded to the server it is not centered. The website is left justified but other than that, it looks great. The content and everything is exactly where it is supposed to be it's just that the site itself is way to the left. How do I center this? It looks the same in IE and FireFox so I know it has something to do w/ the code.

Please, any tips????
#centering #website
  • Profile picture of the author nmh
    figured it out!!! Align=center in the code and it said left. Sorry for the newbie posting
    {{ DiscussionBoard.errors[1895158].message }}
  • Profile picture of the author BobJutsu
    Actually, you should be using margins to center align it. Just apply an auto left/right margin to the container:

    container {
    margin: 0px auto;
    }

    Be absolutely sure to declare a valid doctype to, or IE will ignore the margins
    {{ DiscussionBoard.errors[1895317].message }}
    • Profile picture of the author antonisid
      Originally Posted by BobJutsu View Post

      Actually, you should be using margins to center align it. Just apply an auto left/right margin to the container:

      container {
      margin: 0px auto;
      }

      Be absolutely sure to declare a valid doctype to, or IE will ignore the margins
      Yeap...this is the right way to center a page.
      {{ DiscussionBoard.errors[1897736].message }}
  • Profile picture of the author haswow
    To make work in all browsers use the following,
    set continer's "margin: 0px auto;"
    "body: text-align:center;"
    {{ DiscussionBoard.errors[1904641].message }}
    • Profile picture of the author BobJutsu
      Originally Posted by haswow View Post

      To make work in all browsers use the following,
      set continer's "margin: 0px auto;"
      "body: text-align:center;"
      text-align: center; will align, as is implied, the text...which isn't usually a good thing to apply to a body element.
      {{ DiscussionBoard.errors[1912066].message }}

Trending Topics