I would like to put a scollbar in my page so that people would not see all the comments in my commentbox and would have to scroll down. I do not want to add an iframe or a textarea to do this. How can i do this?

Sanchixx

Recommended Answers

All 6 Replies

Your browser doesn't show the scroll at on the right side?

No i would like to have a second scrollbar to scroll down the comments.

Ok, understood. How about applying the scroll style to the element. For example...

#div1 {overflow:scroll;}

overflow:scroll;

ok but could i hide it if it's not long enough to scroll?

The scrollbar won't display if there's no overflow.

Set the proper height to DIV.

#comment {height: 300px; overflow: auto}

Will show scroll bar when the content overflow of parent (i.e, more than 300px height).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.