CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
CSS Combat
'MAIN BODY' Moves on navigation button press
brianK
Permalink to comment
#
November 2008
Hey everyone I've got a simple problem that I can not figure out.
:oops:
When I navigate to any page within my site the whole 'BODY' jumps to the left 5 pixels or so. What would be the reason behind this and the fix?
My site pages are fixed at 960px wide and any time I navigate to a longer page the whole 'BODY' moves just enough to annoy...
Full XHTML and Strict CSS
no tables!
If you have any feedback i would appreciate it! Thanks :D
toby
Permalink to comment
#
November 2008
This is caused by the scrollbar appearing when your page is longer than the window.
You can either set the height of the html tag to 101% so the scrollbar is always there or do this.
html {
overflow-y: scroll;
}
The later won't validate unless you inject it dynamically with something like jQuery.
Should sort it out.
brianK
Permalink to comment
#
November 2008
That's perfect! :idea:
For some reason I never accounted for the scroll bar but assumed there had to be a fix.
Thanks for your help!
brianK
Permalink to comment
#
November 2008
I have to express my thanks again, It was so simple but did not know where to look.
Im a free man again
!
Add a Comment
When I navigate to any page within my site the whole 'BODY' jumps to the left 5 pixels or so. What would be the reason behind this and the fix?
My site pages are fixed at 960px wide and any time I navigate to a longer page the whole 'BODY' moves just enough to annoy...
Full XHTML and Strict CSS no tables!
If you have any feedback i would appreciate it! Thanks :D
You can either set the height of the html tag to 101% so the scrollbar is always there or do this.
html {overflow-y: scroll;
}
The later won't validate unless you inject it dynamically with something like jQuery.
Should sort it out.
For some reason I never accounted for the scroll bar but assumed there had to be a fix.
Thanks for your help!
Im a free man again!