Re: border on 100% height body creates scroll



In article
<cd5cad54-e7e4-4e36-af66-04d5069d1327@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
msoliver <michaelsoliver@xxxxxxxxx> wrote:

I'm trying to figure out why the following creates a vertical scroll
bar.

Browser is IE 7 - using XHTML 1.0. I expand html and body to height
of 100% and then I want to put a border around the whole viewport.
What happens is that I get a vertical scrollbar (which I can hide, of
course).

Essentially what I'd like to know why adding a border increases the
block but not the 100% sized viewport (and thus the scrollbar).

You can't do much via CSS to the viewport. It is just a window through
which to see webpages, If they don't fit, the browser gives you scroll
bars to bring stuff into view. the size of the viewport is really just
under your control, you can make it as big as your screen or as small as
it will go.

When you add borders to an element, the content part of the element does
not shrink to accommodate the borders. The borders go on in addition.
And the browser insists they might be something you want to see and so
it brings up scrolling. The scrollbars get counted

<http://dorayme.890m.com/alt/oliver.html>

If you have already set the height of the html element to be 100% of the
viewport and then body also to 100% of the html, and further if you set
a div inside body to be 100% of body, then where are borders to go? They
go out of view.

You might think, so who cares about borders. Well, imagine the Russians
are on to you and you know that the thickness and colour of the borders
are a possibly informative sign to their agents about whether the
Kremlin requires your elimination or merely your cellar to store some
vodka without paying duty on it. If you know the signs, you will want to
see those borders and the browser is your friend here. It gives you the
means. No browser I know of has ever been Russian friendly. The Russians
did try to make a browser that had no scrollbars but it was an absolute
disaster, like a car they made.

If you don't believe all this stuff, that is quite ok. Just join some
serious characters in the Reading Room and peruse:

<http://www.w3.org/TR/CSS21/box.html>

Perhaps you might also take a look at:

<http://tinyurl.com/w322t>

--
dorayme
.



Relevant Pages

  • Re: Place a DIV above all site content
    ... but that of the browser itself, at least in FF3. ... Viewport is Viewport and for looking at webpages. ... comparing it to a mere desktop window. ...
    (alt.html)
  • Re: Unnecessary scrollbars
    ... scrollbars should appear, where they are big, scrollbar should appear ... the side of the document in the Hebrew version, ... If you are bringing this up, is it because you believe that such has some relationship to the other layout issues and long, complex CSS code you brought so far. ... Identify the browser and browser versions which show what you believe to be problems. ...
    (comp.infosystems.www.authoring.html)
  • Re: using "col" and "colgroup" tags in firefox?!?
    ... For example, if I am compiling a list of whatever, I may copy and paste from the website into Notepad or a word processor, and run both programs side by side. ... When the left third of the viewport is empty, all that space is wasted and I have to shrink the viewport and scroll right, or hang the window off the edge of the screen, in order to read what the website says. ... As for your contention that "filling the viewport" is a reason why people don't like certain sites, I'd say that the problem is rather that long lines are harder to read than short ones, and it would be nice if the presentation could be in columns, like a newspaper. ... That would be a nice trick for the browser to be able to perform (and actually, there is no reason I can see why a browser should not have a user preference to present text ...
    (alt.html)
  • Re: div tag help
    ... There is the viewport, and the dimensions of the root element. ... latter is bigger than the former, the browser gives you scrollbars. ...
    (alt.html)
  • Re: Help re how to float nav items around graphic ?
    ... >>1) Does your content work in a range of viewport widths? ... >>Is tested by varying the width of your browser window. ... >>Is tested by zooming the text using IE and Mozilla. ... Browser viewport widths are ...
    (comp.infosystems.www.authoring.stylesheets)