A scrollable Div

Well I was asked if I could out content in a window that was scrollable without using an iframe. I personally dislike iframes so I was happy to oblige. Its actually quite a simple task when you get down to it, so lets get started.

1. Create your div.

<div>Paragraph or two of text here….</div>

2. Add the styles to the div.

<div style=”overflow:auto; width:200px; height:200px;”>Paragraph or two of text here….</div>

If you’re using a linked stylesheet or defining it in the header you would use this CSS:

div.scrollable {
width: 200px;
height: 200px;
overflow: auto;
}



One Response to “A scrollable Div”  

  1. 1 Gray

    Oh and don’t forget to class your div with the same class as in the css class=”scrollable”.

Leave a Reply