Pages

Wednesday, September 15, 2010

Making HTML div scrollable

suppose you want to make a HTML div scrollable and limit it to a certain width and height. You can achieve this by using the following code
<div style=”width:500px, height:600px, overflow=auto”> </div>

That line of code will set the div to 500 x 600 and if the content of the div exceeded that size, the div will become scrollable automatically. The parameter responsible for this effect is: overflow=auto

No comments:

Post a Comment