HighDots Forums  

Re: container moves when scroll appears

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: container moves when scroll appears in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris F.A. Johnson
 
Posts: n/a

Default Re: container moves when scroll appears - 02-12-2008 , 10:42 PM






On 2008-02-12, warth33 (AT) hotmail (DOT) com wrote:
Quote:
I am experiencing a problem with Firefox.

I have two html-pages, and both use the same css-file. Its about
having an header, that makes the pages to look the same at the top for
all the pages.

There are two html pages.
index.html:
....
next.html:
....
The file style.css:
....
Well, in IE there are no problems. If I go forth and back between the
pages, then the header is in the exact same position.

In firefox, when I go from a page to another, then the header moves a
few pixels. This is not so good. It depends on the fact that the first
page doesnt contain so much, so the browser never need to display the
scrollbar. And that the other page (where I put a lot of <br> just to
simulate), beeing with more content, will force the browser to display
the scrollbar.

So, in short: two pages with the exact same code, will place a div in
two different positions inside the browser, depending on if the
scrollbars exists or not.

Well, maybe this is not a problem, but only the cause of an incorrect
style? Do ou think there is a solution to this?
If one window has a scroll bar and the other doesn't, then the size
of the windows are not the same. If you centre something, it cannot
be in the same place in both.


--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)


Reply With Quote
  #2  
Old   
warth33@hotmail.com
 
Posts: n/a

Default Re: container moves when scroll appears - 02-13-2008 , 03:51 AM






Quote:
* *If one window has a scroll bar and the other doesn't, then the size
* *of the windows are not the same. If you centre something, it cannot
* *be in the same place in both.
Well, but this is not true for IE.


Reply With Quote
  #3  
Old   
John Hosking
 
Posts: n/a

Default Re: container moves when scroll appears - 02-13-2008 , 05:57 AM



warth33 (AT) hotmail (DOT) com wrote:
Quote:
If one window has a scroll bar and the other doesn't, then the size
of the windows are not the same. If you centre something, it cannot
be in the same place in both.
Well, but this is not true for IE.
Yes, yes, yes. IE always uses space for a vertical scrollbar, even when
the content doesn't require it. Firefox provides a scrollbar only when
it's necessary. I haven't checked all the other visual browsers, but
these two are different from each other in that way. It's just how they are.

IE's behavior regarding horizontal scrollbars matches that of the other
browsers (and that of other browsers' treatment of vertical scrolling).

I consider this one of those mysteries of life, a challenge for us to
deal with, an aspect of our existence which will be forever unexplained.
I don't believe there is anything good we can do about it.

You can add html {overflow: auto; } to make IE hide its vert scrollbar
for short pages, but then you get a horiz scrollbar when the vert
scrollbar shows up. Nastier than the "problem" you have now.

You can make all of your pages arbitrarily overlong so that all pages in
all browsers in all display situations have a vertical scrollbar, but if
you do that, I won't hang around your pages very long, your visitors
won't enjoy their visits as much, and if you tell anybody I suggested
doing that, I will slay you.

You can develop a browser that behaves as IE does ( :-( ) but that is
otherwise so amazingly great that everyone rushes to adopt it,
abandoning browsers with differing scrollbar behavior. But that might
take some time.

In summary: Learn to live with it.


--
John
Read about the UIP: http://improve-usenet.org/


Reply With Quote
  #4  
Old   
Bergamot
 
Posts: n/a

Default Re: container moves when scroll appears - 02-13-2008 , 06:02 AM



warth33 (AT) hotmail (DOT) com wrote:
Quote:
If one window has a scroll bar and the other doesn't, then the size
of the windows are not the same. If you centre something, it cannot
be in the same place in both.
Well, but this is not true for IE.
Is your complaint the fact that IE always has a vertical scrollbar
present, and Firefox only does when the content needs it? If so, then
get over it.

--
Berg


Reply With Quote
  #5  
Old   
warth33@hotmail.com
 
Posts: n/a

Default Re: container moves when scroll appears - 02-13-2008 , 06:30 AM



On 13 Feb, 12:57, John Hosking <J... (AT) DELETE (DOT) Hosking.name.INVALID>
wrote:
Quote:
wart... (AT) hotmail (DOT) com wrote:
* *If one window has a scroll bar and the other doesn't, then the size
* *of the windows are not the same. If you centre something, it cannot
* *be in the same place in both.
*Well, but this is not true for IE.

Yes, yes, yes. IE always uses space for a vertical scrollbar, even when
the content doesn't require it. Firefox provides a scrollbar only when
it's necessary. I haven't checked all the other visual browsers, but
these two are different from each other in that way. It's just how they are.

IE's behavior regarding horizontal scrollbars matches that of the other
browsers (and that of other browsers' treatment of vertical scrolling).

I consider this one of those mysteries of life, a challenge for us to
deal with, an aspect of our existence which will be forever unexplained.
I don't believe there is anything good we can do about it.

You can add html {overflow: auto; } to make IE hide its vert scrollbar
for short pages, but then you get a horiz scrollbar when the vert
scrollbar shows up. Nastier than the "problem" you have now.

You can make all of your pages arbitrarily overlong so that all pages in
all browsers in all display situations have a vertical scrollbar, but if
you do that, I won't hang around your pages very long, your visitors
won't enjoy their visits as much, and if you tell anybody I suggested
doing that, I will slay you.

You can develop a browser that behaves as IE does ( :-( ) but that is
otherwise so amazingly great that everyone rushes to adopt it,
abandoning browsers with differing scrollbar behavior. But that might
take some time.

In summary: Learn to live with it.

--
John
Read about the UIP:http://improve-usenet.org/
Oh well, thank you for your philosophical answer.
Yes, this is the browser's behaviour. I understand, you cannot do
anything about it, but of course the visual effect is quite annoying.
Thats why I asked.







Reply With Quote
  #6  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: container moves when scroll appears - 02-13-2008 , 11:49 AM



warth33 (AT) hotmail (DOT) com wrote:
Quote:
On 13 Feb, 12:57, John Hosking <J... (AT) DELETE (DOT) Hosking.name.INVALID
wrote:

IE's behavior regarding horizontal scrollbars matches that of the other
browsers (and that of other browsers' treatment of vertical scrolling).
<snip>

Quote:
You can develop a browser that behaves as IE does ( :-( ) but that is
otherwise so amazingly great that everyone rushes to adopt it,
abandoning browsers with differing scrollbar behavior. But that might
take some time.

In summary: Learn to live with it.

Oh well, thank you for your philosophical answer.
Yes, this is the browser's behaviour. I understand, you cannot do
anything about it, but of course the visual effect is quite annoying.
Thats why I asked.
Then adjust your design so it is not an issue.

BTW, PHP code within your stylesheet is not valid

<?
header("Content-type:text/css");
?>


You could use a PHP script to load your stylesheet

<link href="CSSLoader.php" type="text/css" rel="stylesheet" />

But not sure why, your Apache server already has the mime type text/css
associated with CSS files.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.