|
Internet Explorer 6 Vertical Scroll Bar Not Appearing
|
|
| |
Rating: 282 user(s) have rated this article
4.7 out of 5 stars
Posted by: jstrosch01,
on 3/27/2008,
in category "Working with HTML"
Views: this article has been read 4179 times
Location: United States
During some recent development I ran into a problem with IE6's vertical scroll bar not appearing on a DIV when the content extened past the DIV's height. The overflow was working fine with FireFox and IE7, so I really wasn't sure where to begin with this one. After futively scouring the internet for an hour I finally stumbled upon my answer by simply adding/removing styles in the CSS where the DIV was getting it's attributes. Here's the original CSS:
/* Styles.css */
#rightContent {
height: 340px; overflow: auto;
} |
And this is the DIV:
<!-- SomePage.aspx -->
<div id="rightContent"> <div>
|
Since I'm creating this content dynamically I'm using ASP.NET and adding content via the page's code-behind file (not discussed here). At this point I was not getting the vertical scroll bar in IE6. You'll notice that I don't have the position set and that is what I was missing. After setting the position to relative (which is how I wanted this DIV to layout anyway) the vertical scrollbar would appear when the content extended past the DIV's height.
/* Styles.css */
#rightContent {
Position: relative; height: 340px; overflow: auto;
} |