Forum Moderators: open

Message Too Old, No Replies

How do I create a scroll box?

Need to create a scroll box that can use html effects

         

Cogen

11:57 am on Apr 13, 2002 (gmt 0)



Can anyone please tell me how to create a text box which you can put html in and it uses the code...not shows it to viewers.

this means a cant use "<textarea>"

joshie76

12:07 pm on Apr 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Cogen, welcome to WebmasterWorld

try a div,

<div style="height:50px;width:200px;overflow:scroll">
content content content content content content content content content content content
content content content content content content content content content content content
</div>

or if you only want a vertical scrollbar

<div style="height:50px;width:200px;overflow-y:scroll">

Instead of forcing the scrollbars you can allow the div itself to decide whether it needs them (x or y) if you use overflow:auto

Obviously though, the user can't edit the content of a div or post it as part of a form.

Cogen

3:09 pm on Apr 14, 2002 (gmt 0)



thanks very much :)
thats what i wanted. is there any way i can put a border on the box to make it stand out from the background?

joshie76

3:35 pm on Apr 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can add the following to your style attribute (or class obviously)
border:1px solid #000066;

I think all this stuff is only going to work in browsers that can handle relativley advanced CSS so not NN4. You should be fine with NN6, mozilla, IE4+ and Opera.