www.webdeveloper.com
Results 1 to 8 of 8

Thread: Center of page moves when page changes

  1. #1
    Join Date
    Jan 2010
    Posts
    10

    Center of page moves when page changes

    Hi Guys

    Forgive me if this has been answered before - I can't find a reference to it - perhaps I'm using the wrong words.

    When one of my pages exceeds a certain length, the centre seems to shift. This doesn't happen in IE but seemingly all the other browsers.

    I thought it was because I'm using tables, but the header is in a div so I'm not so sure.

    My draft site is at www.steamchicken.co.uk/76/index.html and the "how to find us" page is the offending one.

    Thanks in advance.

    M

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Add a valid DTD
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    and
    Code:
    html {overflow-y:scroll;}
    This will force a scrollbar on the index page.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Jan 2010
    Posts
    10
    Thanks for the suggestion but no joy.

    It's still moving! My editor overwrites the Doctype line but I've edited that in notepad and uploaded.

    I put the overflow force in my stylesheet (hope that was the intention).

    I'm using Opera to test this. Any other ideas?

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    You haven't added
    Code:
    html {overflow-y:scroll;}
    At least 98% of internet users' DNA is identical to that of chimpanzees

  5. #5
    Join Date
    Jan 2010
    Posts
    10
    Sorry - thought it should be in the style sheet.

    Where should it go - sorry to be thick.

  6. #6
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    It's correct, only the rule just before it has incorrect brackets
    Code:
    div.menu ( 
    	position:absolute;
    top:0; 
    left:0;
    
    )
    At least 98% of internet users' DNA is identical to that of chimpanzees

  7. #7
    Join Date
    Jan 2010
    Posts
    10
    I suppose you already know you are a genius!

    Thank you for your time and trouble.

    I didn't even need that bit of code.

    I'm starting to think I need to let my tables go and move to divs - do you know a good tutorial - or should I make a new post for this?

    Thanks again - really appreciate it.

  8. #8
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    A new post.
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles