• Morning,

    I am having some trouble in getting this site to center on the page. I have tried tweaking it anyway I know, as well as implementing different techniques found in various tutorials. I am at a loss, and need a pair of fresh eyes to take a look and let me know what I might be doing wrong. Help!

    Site is located at http://www.babcox.com/site

    Thanks!

Viewing 1 replies (of 1 total)
  • just taking a quick guess here, your theme has a bit of a strange structure, normally there is a wrap that holds all the elements within, yours doesn’t do that, you top section, and main section are totally separate….

    that being said here’s your header in style.css

    #header { width: 963px; padding: 21px 0 0 0; /*padding-left: 50px; */ margin-left: auto; margin-right: auto; }

    and here’s your content area:

    #wrap { margin: 0px auto; width: 2000px; margin-left: auto; margin-right: auto;  }

    and

    #content #main { margin: 0px auto; width: 2000px; background-color: #ffffff; }

    why are the 2 css elements associated with site so wide? (2000px?) while your header is at 963px?

    having your header at 963px with left/right margins at auto, sets the width of the element, and then centers it.

    your other 2 elements are so wide, they can’t look centered. I would think if you bring those down to the same size as the header, it would help (do the #content #main first and test your site by pressing ctrl+f5 while looking at it you may only need to adjust that one) margin: 0 auto; is the code to center, so that’s right (except adding in margin-left: auto; margin-right: auto; is redundant when you already have margin: 0 auto; it means the same thing…..

Viewing 1 replies (of 1 total)

The topic ‘Centering Page’ is closed to new replies.