"Rob T." wrote:
I am using a div tag to make an element that contains some text. I
have specified overflow: auto; in my stylesheet. If I use
font-size/line-height to specify the font information I get a vertical
scrollbar in firefox/netscape (not IE) , even though the text I have
in the element does not exceed the bounds. The simple example below
casues this behaviour. How do I fix this?
<div style="overflow:auto; height:100px; width:100px; border:1px
#000000 solid; font:10px/10px Times;">
overflow set to auto.
overflow set to auto.
</div>
The text clearly is within the box, and yet the scrollbar is there.
Any help appreciated.
Rob
In the CSS2.1 specification, see §11.1.1 "Overflow: the 'overflow'
property":
"auto
This value indicates that the content is clipped and that if the
user agent uses a scrolling mechanism that is VISIBLE ON THE SCREEN
(such as a scroll bar or a panner), that mechanism should be
displayed for a box whether or not any of its content is clipped.
This avoids any problem with scrollbars appearing and disappearing
in a dynamic environment. When this value is specified and the
target medium is 'print', overflowing content may be printed."
[emphasis added]
Thus, the lack of a scrollbar in IE is an error. Firefox and
Netscape (both clones of Mozilla) are correct.
--
David E. Ross
<URL:http://www.rossde.com/>
I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.