473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

vertical scrollbar showing when contents do not exceed bounds

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
Jul 24 '05 #1
4 13534
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


Google (and Peter-Paul Koch!) is your friend:

<URL:http://www.quirksmode.org/bugreports/archives/2005/04/When_an_li_element_is_set_to_overflow_auto_Firefox .html>
--
Rob
Jul 24 '05 #2
On Thu, 19 May 2005 06:42:49 GMT, RobG <rg***@iinet.net.auau> wrote:
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


Google (and Peter-Paul Koch!) is your friend:

<URL:http://www.quirksmode.org/bugreports/archives/2005/04/When_an_li_element_is_set_to_overflow_auto_Firefox .html>


Thanks for taking a look. It seems like this person is having a
different problem though. I'm seeing a vertical not horizontal
scrollbar and I'm using div tags. If the font-size is specified
without the line-height the vertical scrollbar goes away. I tried
adding the font information to p in the stylesheet instead of my text
div tag but I get the same results. IE has no problems with this.

Rob
Jul 24 '05 #3
"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/>.
Jul 24 '05 #4
DU
Rob T. wrote:
On Thu, 19 May 2005 06:42:49 GMT, RobG <rg***@iinet.net.auau> wrote:

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


Google (and Peter-Paul Koch!) is your friend:

<URL:http://www.quirksmode.org/bugreports/archives/2005/04/When_an_li_element_is_set_to_overflow_auto_Firefox .html>

Thanks for taking a look. It seems like this person is having a
different problem though. I'm seeing a vertical not horizontal
scrollbar and I'm using div tags. If the font-size is specified
without the line-height the vertical scrollbar goes away.


The default value for line-height in Mozilla-based browsers is 1.2. So
your content should fit without causing an overflow into a line box 20%
longer.

My recommendation is to never play with line-height values unless you
know well what you're doing.

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Firefox 1.0.4 :)
Jul 24 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Z | last post by:
Hi, I have problem with auto-scrolling frames in IE (6.0 on Xp, but same happens with IE 5.5 on Win2k): If I set scrolling="auto" to frame, IE reserves space where vertical scrollbar normally...
7
by: Barbara de Zoete | last post by:
On one of my pages http://home.wanadoo.nl/b.de.zoete/html/tekeningen.html I have a div containing thumbnails (who ever came up with that word?) to select a larger view of a picture. The div is...
2
by: Nathan Wallace | last post by:
When in quirks mode, IE seems to be able to display pages without any vertical scrollbar: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <style> body {...
3
by: buht | last post by:
Hello Everyone, Fairly new to c# here and have a question regarding scrollbars, particularly a vertical scrollbar. It looks like my options are restricted for the textbox scrollbars being...
1
by: scott8000 | last post by:
hi all Access 2K/2003, Win XP Pro I need to be able to detect when a subform datasheet is currently displaying a vertical scrollbar. I.e if the subform datasheet is showing more records...
1
by: Tom | last post by:
First, I posted a similar request for help in another group and now don't find the posting. Problem with my newsreader perhaps ... but apologies if this appears as a cross posting. My code is...
1
by: webdev1 | last post by:
Hi, I have set scrolling="auto" in my iframe, so when the height of iframe(Content) is more than the allocated height, vertical scrollbar appears.....Works perfect in Firefox, but when it comes...
10
by: quddusaliquddus | last post by:
I am running this: http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm It works fine except the vertical scrollbar disappears when the image is clicked. What should I do?
0
by: yatinbvn | last post by:
hi , my name is yatin i have creating swt text with vertical scroll bar in shell, my question is: vertical scroll bar thumb is still visible in swt text when its size is not increase , i want...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.