Scrollbars

When CSS2 defines the overflow property [1], it doesn't specify where
the scrollbars, if used, are to be placed, and I don't think the spec
says anywhere where they should be placed.  I think this should be
specified because it could end up being a serious difference between
implementations that makes the property essentially unusable because of
visual messiness (i.e., one browser could change the padding when
something is scrolled and one could place the scrollbar on top of the
padding).

Here are two interesting situations to think about when deciding how
this should be done:

1) An element that has margins, border, and padding, and a scrollbar.

2) An element that has padding and a positioned non repeating
   background image in the upper-right (vertical scrollbars only) or
   lower right corners.

3) An element that has margins, padding, and border-width of 0.

I think the scrollbar should be placed between the border and the
padding (on the appropriate side, which depends on whether it is
horizontal or vertical and possibly on the direction of the text) so
that the padding edge, rather than touching the inside of the border,
touches the scrollbar.

This would handle the case of background images properly, and would
also make sense where there are margins, borders, and padding.  I think
the scrollbar should definitely touch the border in some way, since
otherwise scrollbars could end up floating in the middle of nowhere.
It would also handle the case of something that has margins, padding,
and border set to zero.

Having the scrollbar overlap the padding, border, or margin could
create problems in the case of all three of the above being zero,
especially with elements that have "overflow: auto", where it would be
undesirable to create extra room to allow for a scrollbar that may or
may not exist (especially since the scrolling mechanism does not have
to be a scrollbar).

David Baron

[1] http://www.w3.org/TR/REC-CSS2/visufx.html#overflow

Received on Wednesday, 20 January 1999 20:20:54 UTC