Log in

View Full Version : Div with scrollbars



MrH2o
02-20-2007, 03:54 PM
Hello!

I'm trying to make a div with a scrollbar but I can't get it to work properly.

Here's the page (http://www.lagerhaus.se/var-arbete2.html)

Press the Stockholm area (The one with the most dots in it, if you arent Swedish :) ) and notice how the div grows by itselfs. As you can see in my code I have giving the div and the cell thier height in px, I've also set the div to have scrollbar function but this aint working...


<td width="370" height="400px" align="left" valign="top"><div id="contentarea" height="370px" width="400px" style="overflow:auto;"></div>


</td>

If anyone know why? please reply. Thanks!

mburt
02-20-2007, 04:06 PM
All you have to do is set the height to your desired height and set in the css:

overflow:auto

jscheuer1
02-20-2007, 04:11 PM
Division elements cannot have their dimensions set via attribute as you have done. They must be set as a part of the style:


<div id="contentarea" style="width:400px;height:370px;overflow:auto;"></div>

There could also be other problems.