100% ≠ 100%?
Overview Article
Part 3 -
As the Stomach Turns....
The results of the experiments for both the div and the body elements, when used as the Container Block are almost a carbon copy for each Browser tested. Consquently, the results have been summarized a single comparison table:
| Element | VERTICAL INTEGRITY (Height Calculation) |
HORIZONTAL INTEGRITY (Width Calculation) |
|
|
IExplorer 7.0 |
DIV |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does Not compensate for the presence of the Vertical Scrollbar.
|
| BODY |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Special Case!
|
|
|
Mozilla 1.72 |
DIV |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does compensate for the presence of the Vertical Scrollbar.
|
| BODY |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does compensate for the presence of the Vertical Scrollbar.
|
|
|
FireFox 1.5 |
DIV |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does compensate for the presence of the Vertical Scrollbar.
|
| BODY |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does compensate for the presence of the Vertical Scrollbar.
|
|
|
Netscape 8.1 |
DIV |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does compensate for the presence of the Vertical Scrollbar.
|
| BODY |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does compensate for the presence of the Vertical Scrollbar.
|
|
|
Opera 9.01 |
DIV |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does Not compensate for the presence of the Vertical Scrollbar.
|
| BODY |
Does Not compensate for the presence of the Horizontal Scrollbar.
|
Does Not compensate for the presence of the Vertical Scrollbar.
|
Conclusions: Alka Seltzer Time!
The logic (or the illogic) - based on the height/width calculations, used by these browsers to activate and control the scrollbar(s) are totally Bizarre!, to say the least.
However, let's put our "scientist hat" back on and try to analyze the results objectively, starting with the rather "straight-forward" ones:
- Each Browser tested uses the same set of "control calculations/logic" to control the Scrollbars of the div element and the Default Scrollbars.However, the logic used by each of the Browsers studied to control the Vertical Scrollbar is not the same as the one used for the Horizontal Scrollbar, the only exception being the Internet Explorer.
-
For any given Browser, the Thickness of the Scrollbars for the div element are the same as those of the Default Scrollbars. Furthermore, the Thickness of the Vertical Scrollbar is equal to that of the the Horizontal Scrollbar, namely:
- Internet Explorer & Opera: 17px
- Mozilla, FireFox & Netscape: 19px
Proceeding on to the more complicated "Scrollbar Control" related considerations, we also clearly see three different patterns:
- Self Adjusting:
The calculations made to determine the height and/or width of the area available for the Liner block takes into consideration the presence (or absence) of each scrollbar individually. And, consequently, 100% height/width settings for the Liner Block become self-adjusting. An illustration of this would be that a 100% width setting for the Liner Block would result in:
-
If the Vertical Scrollbar is absent:
Width of Liner Block (in px) = Width of the Container Block (in px). -
If the Vertical Scrollbar is present:
Width of Liner Block (in px) = Width of the Container Block) minus (Thickness of the Vertical Scrollbar)] (in px)
- Mozilla: Horizontal Integrity (Width Calculations)
- FireFox: Horizontal Integrity (Width Calculations)
- Netscape: Horizontal Integrity (Width Calculations)
-
If the Vertical Scrollbar is absent:
- Over Compensation:
The calculations made to determine the height and/or width of the area available for the Liner block is based on the absolute values of the Liner Block is being equal to that of the Container Block at all times. When a Scrollbar is present, the Thickness that scrollbar scrollbar is tacked on the height/width of the Liner Block individually. And, consequently, the other scrollbar of the Container Block is activated prematurely. An illustration of this would be that a 100% width setting for the Liner Block would result in:
-
If the Vertical Scrollbar is absent:
Width of Liner Block (in px) = Width of the Container Block (in px). -
If the Vertical Scrollbar is present:
Width of Liner Block (in px) = [(Width of the Container Block) plus (Thickness of the Vertical Scrollbar)] (in px)
- IExplorer: Horizontal Integrity (Width Calculations)
- IExplorer: Vertical Integrity (Height Calculations)
- FireFox: Vertical Integrity (Height Calculations)
- Opera: Vertical Integrity (Height Calculations)
-
If the Vertical Scrollbar is absent:
- Under Compensation - Dead Zone:
The calculations made to determine the height and/or width of the area available for the Liner block is based on the absolute values of the Liner Block is being equal to that of the Container Block at all times. When a Scrollbar is present no action is taken. The other scrollbar is only activated when the height/width of the Liner Block exceedes that of the Container Block at least by 1 px. And, consequently, the scrollbar of the Container Block is superimposed on its contents, thus creating a "Dead Zone" equal to the Thickness of the scrollbar of that particular browser. An illustration of this would be that a 100% width setting for the Liner Block would result in:
-
If the Vertical Scrollbar is absent:
Width of Liner Block (in px) = Width of the Container Block (in px). -
If the Vertical Scrollbar is present:
Width of Liner Block (in px) = Width of the Container Block (in px)
- Mozilla: Vertical Integrity (Height Calculations)
- Netscape: Vertical Integrity (Height Calculations)
- Opera: Horizontal Integrity (Width Calculations)
-
If the Vertical Scrollbar is absent:
Special Case - IExplorer....
It is a very well known fact that the Default Vertical Scrollbar is ever-present, whether its active or not.
This is a deliberate Band-Aid ("Patch" as MS likes to call them) to avoid premature activation of the Default Horizontal Scrollbar, due to Over Compensation as discussed earlier.
This "Patch" can be Un-Done, and this ever-present Default Vertical Scrollbar can be removed easily and legally (i.e. without any hacks)!
« Reference: The Disappearing Act »
www.web-zonez.com/screen/100/dis1.html
Dead Zone - Band-Aids:
At the present, the only remedy to the Dead Zone problem (i.e. "illegal clipping") I can offer, is no more than a band-aid:
- Mozilla & Netscape:
This is due to the fact that the Vertical Scrollbar is activated only when the height of the contents exceeds the height of the Container Block - be it a div or body, by at least one px, whether the Horizontal Scrollbar is present or not. This can be remedied by leaving some form of a white space at the bottom - 20px minimum! This can be made palatable to users, and even be presented as being a part of the design, since vertical scrolling is accepted as a fact of life (like taxes)....
Please Note That....
This may become a non-issue in longer content/pages that exceed its Container Block by at least 20px. However, determination of such, especially in the case of the body element, may not be that simple. - Opera:
Similarly, this is due to the fact that the Horizontal Scrollbar is activated only when the width of the contents exceeds the width of the Container Block - be it a div or body, by at least one px, whether the Vertical Scrollbar is present or not. This is rather serious issue - or, rather, a very serious problem, in the case of the body element, since this Dead Zone will be present through out the entire length of the page, not only at the bottom. Again, leaving some form of a white space on the very right - 18px minimum, may be one option. However, this may not be as simple or as palatable, and may become too high a price to pay, just to appease Opera.... Well, of course, as a web designer, you can choose just to ignore Opera. (Almost every experiment conducted by WebZoneZ, makes it more obvious that the Browser's License of Opera should have been revoked long ago.)
Please Note That....
Again, this may become a non-issue in wider content/pages that exceed the width of its Container Block by at least 18px. Again, the determination of such, especially in the case of the body element, may not be that simple.
The Poison Pill:
When it comes to the div element, there is another option that will remedy all of the above, as distasteful as it may be:
» Setting the "overflow" property to 'scroll'.
However, this is not even an option, when the body element is used as the Container Block, since the Default Scrollbar control and behavior varies greatly from Browser to Browser.
« Reference: Scrolin' Along... »
www.web-zonez.com/screen/scroll/index.html
Bottom Line
Besides the Poison Pill for the div element, I can not come up with any other imaginative solution. However, it does mean that somebody out there may not! If you do, please let me know using the Feed-Back Form.
Obviously, the real solution lies with the browsers. They are the only ones who can correct this Fundamental Flaw. However, I do not think that it is a surmountable task, neither will it require a brain surgery. Just to illustrate this point, I put together a rather simple and non-language specific logic for review in Just A Bite of Logic. www.web-zonez.com/screen/100/1004.html
Moving Along...
If you have have had enough with this topic - contents of which are listed in the Auxiliary Panel on the left, you may want to consider looking into (if you have not already done so) the other main topics of this section:
-
Privileged Ones
Investigation into the Browser given Privileges of the body, html and phantom elements. www.web-zonez.com/screen/duo/index.html -
Scrolin' Along...
Investigation into the behavior of the Browser Default Scrollbars as a function of the overflow property of both the html and the body elements. www.web-zonez.com/screen/scroll/index.html
On the other hand, you can also take a short-cut and go to the overall summary of this entire section at Screen Mysteries. www.web-zonez.com/screen/index.html
- Feed-back & Comments:
- Please send any comments, opinions, and even contributions on this subject, using the Feed-Back Form.
- Further Reading:
- You can review the list of Related Articles, with brief descriptions and links on the Auxiliary Panel,









