|
|
Centred Page - Pixel Jog
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status:
Offline
|
|
Something which drives me batty is the way browsers handle centering a site. If it doesn't scroll, it's in one "centre," yet it jogs over a few pixels when the page scrolls. What's that all about? Why does it seem to have two centres?
Not sure what I'm on about? Check these pages: Example 1 & Example 2
I want answers.
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jan 2002
Status:
Offline
|
|
Well, I don't know why they have persisted. I code a great deal of web applications, and I often have Javascript events that expand/contract the page. When the page grows, it often throws things a little off, since it's now the new center alignment.
I understand why it performs as it does (it's just a window filling all of its space), but I would imagine that a persistent scroll bar would alleviate this problem.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
A web page that requires vertical scrolling adds a scroll bar to the right hand side...... which shifts all the content to the left!
NOTE. Your two examples both require a scrollbar on screens of 1024 x 768 or below. Currently, that's about 80% of web traffic.
|
Piot
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status:
Offline
|
|
Originally Posted by piot
A web page that requires vertical scrolling adds a scroll bar to the right hand side...... which shifts all the content to the left!
Yes, but the content isn't shifted over by the same pixel width as the scroll bar. If it was, I wouldn't be moaning about it, because I could handle that. It's just a few pixels, not about 15-20px, which is what yer average scroll bar weighs in at.
I still want answers.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Apr 2003
Location: Toronto, Canada
Status:
Offline
|
|
Because the content is centred it won't move over to the left the entire width of the scrollbar, only half of the width. The browser removes half of the scrollbar's width from the padding on the left of the content, and half of the scrollbar's width from the padding on the right.
With a screen ruler I can see that the padding is reduced by 8px on either side, for a total reduction of 16px, which, on my system, is the exact width of the scrollbar. Other OS's might have different scrollbar widths, so the padding reduction may vary slightly.
(
Last edited by bwahahax; Jun 1, 2005 at 09:27 AM.
)
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status:
Offline
|
|
When you say 'few pixels' do you mean roughly 8? The scroll bars in OS X are 16px wide, I think, so it would make the centring shift by half the offset, no?
Edit:
Beaten to the post! That's what I get for going and watching telly before finally posting my reply.
|
Just who are Britain? What do they? Who is them? And why?
Formerly Black Book
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status:
Offline
|
|
Okay, I'll probably settle for that. And I'm not even watching tele (although, we do have two in the office).
It's still annoying, though.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
Hey Phil, only just noticed your sig. I'm not being tetchy here, but how come you had this very basic problem with web layout and yet you have actually written a whole book on web dev?
|
Piot
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status:
Offline
|
|
Originally Posted by piot
Hey Phil, only just noticed your sig. I'm not being tetchy here, but how come you had this very basic problem with web layout and yet you have actually written a whole book on web dev?
Because I posted the original question from work, where my brain is usually turned off.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|