• My whole wordpress is aligned to the left for some reason. I’ve tried adding margin: 0 auto; to different spots on the stylesheet and header. I’ve also tried to change the min-width and width of the page lots of times. Nothing seems to work! I’m getting so frustrated with this… Can someone please help me out?

Viewing 15 replies - 1 through 15 (of 20 total)
  • put the content in a div wrapper and make it margin auto. Post a link and I can be more specific

    Have you tried placing the body content in a wrapper DIV? Something like this…

    <body>
       <div id="wrapper">
          ...site contents...
       </div>
    </body>

    Then in your style sheet create a “wrapper” id…

    #wrapper {
       margin: 0 auto;
    }
    Thread Starter sentientprod

    (@sentientprod)

    Yeah already tried that, didn’t work. Actually my theme came with that already…

    Try

    #wrapper{
    margin: auto;
    }

    insted of

    #wrapper{
    margin: 0 auto;
    }

    Can you post the relevant code?

    Thread Starter sentientprod

    (@sentientprod)

    Which code do you want? The stylesheet? The main css stylesheet? The header? And I tried margin: auto; and that didn’t work.

    Which code do you want? The stylesheet? The main css stylesheet? The header?

    Hmm… are you using multiple style sheets? Originally I was hoping to get a look at your #wrapper code but now I’m wondering if it is possible you’re either a) pointing to the wrong external stylesheet in your <link> tag, or b) overriding the #wrapper definition with an internal <style> declaration.

    Thread Starter sentientprod

    (@sentientprod)

    My theme uses a stylesheet and a custom stylesheet. The wrapper code is the custom stylesheet and the html part is in the header. This is what the wrapper code looks like now:

    #Wrapper { width:100%; margin: 0 auto; }

    `

    Thread Starter sentientprod

    (@sentientprod)

    Here is the code for the custom css called sentient.css https://pastebin.com/dgz8agnR.

    Also, here’s the header https://pastebin.com/NAu3k3jN

    And the stylesheet https://pastebin.com/e02tKu7x

    You should try specifying an absolute width for your wrapper.
    #wrapper { width: 960px; margin: 0 auto; }

    Thread Starter sentientprod

    (@sentientprod)

    tried that before and that didn’t seem to work

    What is your url?

    You should try specifying an absolute width for your wrapper.
    #wrapper { width: 960px; margin: 0 auto; }

    I agree… It looks like what is happening is that the #wrapper element is set to 100% of the containing element which, in this case, is the <body> tag. So essentially you’ve set it to fill the whole page. Setting width: 960px; will constrain #wrapper and allow it to be centered.

    In other words, you are being centered… you’re just being centered at 100% of the screen.

    You know… was just looking at your code… I don’t see where you link your “sentient.css” file in the header… am I missing it?

    Thread Starter sentientprod

    (@sentientprod)

    I don’t know where it is going exactly but there’s a menu where you select your custom .css file in the theme options via wordpress. My website is https://www.sentient.mmgtv.org

    Tried editing it to 960px and it seems to work a little but not completely. Still see it aligned to the left but not as much.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Website not centered’ is closed to new replies.