Website is not centered and jumps when navigatign from page to page

Discussion in 'HTML & Website Design' started by postcd, May 8, 2014.

  1. #1
    Hello,

    i want to ask how i can solve this issue that when navigating thru website subpages, the website block is jumping on the screen from left to right, meaning the width of the DIV is i think same, but its somehow not fully centered in the middle of the screen?

    here is the example:
    https://instantcpanelhosting.com

    Example difference is when you switching between "$90 Dedicated server" page and "About Us" page. In source code please where is the difference that makes this jump and not be centered both same way? thx
     
    postcd, May 8, 2014 IP
  2. Karuna17

    Karuna17 Member

    Messages:
    544
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    33
    #2
    On my screen evrthng's ok. no jumping. (chrome)
     
    Karuna17, May 8, 2014 IP
  3. postcd

    postcd Well-Known Member

    Messages:
    1,043
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #3
    I have Chrome too, and its like 2-4 milimetres jumps, in FIrefox too. The "About Us" page block is more on the right.
     
    postcd, May 8, 2014 IP
  4. skible

    skible Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    41
    #4
    hmm... You are right about that. It jumps just a bit. I think this is due to the stripping of the website. You have not contained it in one div, called the "wrapper", on which you should have put the styles like "margin:0 auto;" and "width:960px", this will most likely stop the jumping. I think that some parts are not completely coded well, therefor the bug...
     
    skible, May 8, 2014 IP
  5. hdewantara

    hdewantara Well-Known Member

    Messages:
    538
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #5
    Looks OK on my FF.28 too.
    Except when available width becomes less than 960px. Your .navbar won't budge and stays at 960px, while the others have adjusted their own to the narrower width.
     
    hdewantara, May 8, 2014 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    I am unable to test on my laptop, but I'm guessing the about page, on a larger monitor, does not need to scroll vertically. That means ~24px more room to the right, thus a jump. Add this to your style rules:
    html {
      overflow-y: scroll;
      }
    Code (markup):
    That will force a vertical scrollbar, thus no jump.

    This is a css3 property and may not be supported in older browsers. If supporting dinosaurs with pixel perfection is a requirement, do
    html {
      overflow: scroll;
      }
    Code (markup):
    This will force both horizontal and vertical scrollbars, so isn't as elegant. Ya pays yer money and yer takes yer cherce.

    cheers,

    gary
     
    Last edited: May 9, 2014
    kk5st, May 9, 2014 IP