WordPress.org

Ready to get started?Download WordPress

Forums

Website not centered (21 posts)

  1. sentientprod
    Member
    Posted 2 years ago #

    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?

  2. viktor89
    Member
    Posted 2 years ago #

    put the content in a div wrapper and make it margin auto. Post a link and I can be more specific

  3. pdxchambers
    Member
    Posted 2 years ago #

    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;
    }
  4. sentientprod
    Member
    Posted 2 years ago #

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

  5. viktor89
    Member
    Posted 2 years ago #

    Try

    #wrapper{
    margin: auto;
    }

    insted of

    #wrapper{
    margin: 0 auto;
    }
  6. pdxchambers
    Member
    Posted 2 years ago #

    Can you post the relevant code?

  7. sentientprod
    Member
    Posted 2 years ago #

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

  8. pdxchambers
    Member
    Posted 2 years ago #

    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.

  9. sentientprod
    Member
    Posted 2 years ago #

    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; }

    `

  10. sentientprod
    Member
    Posted 2 years ago #

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

    Also, here's the header http://pastebin.com/NAu3k3jN

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

  11. jmoseley
    Member
    Posted 2 years ago #

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

  12. sentientprod
    Member
    Posted 2 years ago #

    tried that before and that didn't seem to work

  13. jmoseley
    Member
    Posted 2 years ago #

    What is your url?

  14. pdxchambers
    Member
    Posted 2 years ago #

    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.

  15. pdxchambers
    Member
    Posted 2 years ago #

    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?

  16. sentientprod
    Member
    Posted 2 years ago #

    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 http://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.

  17. sentientprod
    Member
    Posted 2 years ago #

    I think it is this line
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" />

  18. pdxchambers
    Member
    Posted 2 years ago #

    That must be where it's doing it then... I checked your site out... looks like it's working?

  19. randycvg
    Member
    Posted 2 years ago #

    I started a WordPress site using Godaddy (http://www.randykarshner.com) and it's fine for a couple hours then all the pages align to the left instead of being centered. The only solution i've found is to hit the dashboard and use the re-install feature. I'm stumped. It doesn't matter what theme I use, and I can't figure out why it's happening. If anyone has any idea I could really, really use some troubleshooting.

  20. nick_byrd
    Member
    Posted 1 year ago #

    Not sure I should "Add on" to this but I am having same issue. None of the CSS edits suggested here are helping me either. My html and css looks like this:

    <!-- Wrapper -->
    <div id="wrapper" class="wrapper">
    (.....rest of site....)
    </div>

    #wrapper {
    width: 960px;
    height: 100%;
    margin: 0 auto;
    background: url(http://www.byrdnick.com/wp-content/uploads/2012/09/seamlesstexture29_1200.png);
    }

    http://www.byrdnick.com

    I am very open to suggestions

  21. Andrew
    Forum Moderator
    Posted 1 year ago #

    Nick_byrd,

    If you create your own thread depicting this issue, you're more likely to receive help.

Topic Closed

This topic has been closed to new replies.

About this Topic