Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<div> overflow:auto does not show scrollbar until resize

I have a element on my form that looks like this:

<div style="overflow-y:auto;overflow-x:hidden;height:100%;width:100%">

In IE7 when the page first renders, there are no scrollbars. However, if I resize the page (even just 1 pixel) the scroll bars appear properly.

Is there something I can do so that the scrollbars show properly when the page first displays?

like image 897
DaveK Avatar asked Aug 13 '09 17:08

DaveK


People also ask

How do I make my scrollbar only appear when overflow?

Use overflow: auto . Scrollbars will only appear when needed. (Sidenote, you can also specify for only the x, or y scrollbar: overflow-x: auto and overflow-y: auto ).

How do I make my Div overflow scroll?

Making a div vertically scrollable is easy by using CSS overflow property. There are different values in overflow property. For example: overflow:auto; and the axis hiding procedure like overflow-x:hidden; and overflow-y:auto;.

Does overflow hidden prevent scrolling?

To hide the horizontal scrollbar and prevent horizontal scrolling, use overflow-x: hidden: HTML.

What is the difference between overflow scroll and auto?

The auto value is similar to scroll , but it adds scrollbars only when necessary: You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.


1 Answers

Set overflow-y to "scroll" if you always want a scrollbar.

like image 151
mothmonsterman Avatar answered Sep 19 '22 21:09

mothmonsterman