Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Parts of page move when others don't

    Hey,

    So here is a page on my site: http://lambdachierau.org/shopping.php
    You will notice that if you change the size of the browser from left to right, the top part of the page and one item on the bottom part of the page goes off center with the rest of the page. Does anyone have any ideas on how to keep everything in sync?

    Here is the html: http://codedumper.com/ayegu
    Here is the css: http://codedumper.com/odepi

    Thank you so much for any help!
    Jonathan

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello schatten,
    12:11am here and your site appears to be down.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Dec 2011
    Location
    San Francisco, CA
    Posts
    24
    Thanks
    0
    Thanked 5 Times in 5 Posts
    That's because you are doing something like:
    Code:
    <body>
        <div id = "myheader"> centered content </div>
        <div id = "mainbody"> <-|-> centered content </div>
        <div id = "footer"> centered content </div>
    </body>
    Whereas, you may need to redesign to following:

    Code:
    <body>
          ... centered ...
        <div id = "container"> a b c </div>
    </body>
    Where a b c is your entire site. You are currently just aligning 3 parts of your site individually, and that is the mistake you're making...

  • Users who have thanked html-tutorials for this post:

    schatten (12-28-2011)

  • #4
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You are a genius!

    Thank you so much html-tutorials,
    Jonathan

  • #5
    New Coder
    Join Date
    Dec 2011
    Location
    San Francisco, CA
    Posts
    24
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Haha, thanks....

  • #6
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Not sure that's going to work properly. You have a strangely coded site.

    You should know why tables for layouts are bad. lol I can see why Excavator and others put this link in their signature!

    Now, all you would really need to do is give an element a width less than its containing element, then in your CSS apply margin: 0 auto; to those elements you want centered. For instance the div that wraps your table(would be better to give it an id and style the id:

    Code:
    <div style="width: 1178px; margin: 0pt auto;">
    Then for your wrapper div:

    Code:
    .wrapper {
        margin: 0 auto;
       /* padding: 0 0 0 200px;*/
        width: 778px;
    }
    I commented out the padding because it's not needed in this case.
    Teed


  •  

    Posting Permissions

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