- Apr 29, 2003
- 48,920
- 46
- 91
I have a portion of my page that I want to scroll if the height is greater than 200px. I accomplished that by using this tag:
<div style="overflow: auto; width: 558px; height: 200px; padding:0px; margin: 0px" align="left">
The problem is, the div tag will take up 200px even if there is only one line of text in it. What I want it to do is take up as much space as it needs to UP TO 200px, and beyond that it will be 200px high and scrollable.
The HTML inside the div tag is database driven, and there is no way for me to tell programmatically how much space it will take up.
Anyone know how to code that?
<div style="overflow: auto; width: 558px; height: 200px; padding:0px; margin: 0px" align="left">
The problem is, the div tag will take up 200px even if there is only one line of text in it. What I want it to do is take up as much space as it needs to UP TO 200px, and beyond that it will be 200px high and scrollable.
The HTML inside the div tag is database driven, and there is no way for me to tell programmatically how much space it will take up.
Anyone know how to code that?
