Submit Your Article Forum Rules

Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Help with centering...

  1. #1
    Senior Member
    Join Date
    Dec 2003
    Location
    Newnan, GA
    Posts
    187

    Unhappy Help with centering...

    This is my problem.
    I switched hosts from Homestead to another hosting site. I couldn't transfer my files; so, I had to upload what I had so far in my new layout.
    Here is my problem.

    Everything is to the left. How do I get it in the middle of the browser? I can't find an answer or explanation that I can understand anywhere.

    This is my first time writing code for my site. I am using notepad++ for the coding and uploading it via am ftp program.

    www.angelsmuseenterprises.com

    Any help would be appreciated.

    I've tried the code from this site http://v1.reinspire.net/blog/2005/09...tered_layouts/, and I am either not copying it right, or something else, because the only thing it seems to center is the heading. *sigh*

    Does it even need to be centered? Is it unprofessional to have it to the left? <<<That may be a dumb question, but as I said previously, I am really new to this.

    Thank you in advance.
    Last edited by Anissa; 01-29-2011 at 08:47 PM. Reason: needed to site information found.

  2. #2
    WebProWorld MVP mjtaylor's Avatar
    Join Date
    Dec 2003
    Posts
    6,237
    It doesn't look to me as though it needs to be centered.
    SEO Friendly Premium Web Directory - Submit Now| Need to write a love letter to Google? I'm an SEO Copywriter who knows Search Smart DesignŽ. | Travel Gypsy in Key West.

  3. #3
    WebProWorld MVP williamc's Avatar
    Join Date
    Jul 2003
    Location
    On a really big hill in Kentucky
    Posts
    4,721
    simply wrap the entire content from <body> to </body> in its own <div> and center that div
    William Cross
    Web Development by Those Damn Coders
    Firearm Friendly Websites because our constitution matters

  4. #4
    Member
    Join Date
    Feb 2010
    Posts
    69
    Quote Originally Posted by williamc View Post
    simply wrap the entire content from <body> to </body> in its own <div> and center that div
    I think the div might need a width - otherwise won't the <div> expand to full screen and the parts that are aligned left within it still end up at the left???

    (I ask because that was my first thought too and tried doing it on copy of her code and it didn't work)


    and I do think centered might look better - or failing that the left margin needs sorting a bit....

  5. #5
    WebProWorld MVP williamc's Avatar
    Join Date
    Jul 2003
    Location
    On a really big hill in Kentucky
    Posts
    4,721
    Yep, something like this would work:

    <div style="width: 800px; margin-left: auto; margin-right: auto;">

    or whatever width the OP needs.
    William Cross
    Web Development by Those Damn Coders
    Firearm Friendly Websites because our constitution matters

  6. #6
    Senior Member
    Join Date
    Dec 2003
    Location
    Newnan, GA
    Posts
    187
    As in <div style="width: 800px; margin-left: auto; margin-right: auto;"><body></body></div>? Again, sorry if it's a stupid questions. I just never thought I would be doing this so soon without having workout the kinks first.

  7. #7
    WebProWorld MVP williamc's Avatar
    Join Date
    Jul 2003
    Location
    On a really big hill in Kentucky
    Posts
    4,721
    <body> <div style="width: 800px; margin-left: auto; margin-right: auto;"> all content here </div> </body>
    William Cross
    Web Development by Those Damn Coders
    Firearm Friendly Websites because our constitution matters

  8. #8
    Senior Member
    Join Date
    Dec 2003
    Location
    Newnan, GA
    Posts
    187
    Quote Originally Posted by williamc View Post
    <body> <div style="width: 800px; margin-left: auto; margin-right: auto;"> all content here </div> </body>
    I just put that in, and did a test page. It only centered the title of the page. *sigh*

  9. #9
    WebProWorld MVP williamc's Avatar
    Join Date
    Jul 2003
    Location
    On a really big hill in Kentucky
    Posts
    4,721
    Hold a few minutes and I will put up a copy of your page that is correct.
    William Cross
    Web Development by Those Damn Coders
    Firearm Friendly Websites because our constitution matters

  10. #10
    WebProWorld MVP williamc's Avatar
    Join Date
    Jul 2003
    Location
    On a really big hill in Kentucky
    Posts
    4,721
    Quote Originally Posted by williamc View Post
    Hold a few minutes and I will put up a copy of your page that is correct.
    Ok, no I won't. It is the css in your stylesheet that is messing up the centering. You are going to have to build the page with centering in mind and stop everything else from being left aligned before its going to work properly. There are also a lot of tags that are not actually real tags in this markup, you might want to fix that. Things like <nav> </nav> <header> </header> etc.
    William Cross
    Web Development by Those Damn Coders
    Firearm Friendly Websites because our constitution matters

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •