W3C home > Mailing lists > Public > www-style@w3.org > January 2013

RE: Proposal for a scrollbar-safe width calculation

From: François REMY <francois.remy.dev@outlook.com>
Date: Fri, 25 Jan 2013 23:41:48 +0100
Message-ID: <DUB002-W6840694B95B1A09C8A37A4A51B0@phx.gbl>
To: Markus Ernst <derernst@gmx.ch>, www-style list <www-style@w3.org>
> Use case 1: Centered web page
> Very many web pages are horizontally centered using a container element
> that has the left and right margins set to "auto". Usually, they suffer
> from a horizontal jump of 8px when navigating between pages that have a
> vertical scrollbar or not. In my authoring practice, I had several
> discussions on this effect with clients or designers who demanded the
> page to stay in it's place regardless of the amount of content. Anyway,
> after I suggested to force scrollbars, they accepted the jump as the
> lesser evil (still considering it as an evil).

Maybe you'll be interested to know how I fixed the issue on my own blog (http://fremycompany.com/BG).

I forced the scrollbar to appear all the time with "overflow-y: scroll" and then I styled the scrollbar. Styling the scrollbar is possible in IE (all versions) and Webkit (all recent versions), which represent a vast majority of users. For the FireFox and Opera users, the scrollbar appears all the time in its default styling which isn't that of an issue. 

Naturally, that works best because the scrollbar background is a solid color and that I use the exact same uniform color for my page background, so the scrollbar is nearly invisible. 		 	   		  
Received on Friday, 25 January 2013 22:42:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:25 UTC