How to create a text box scrollbar

I have a contact-shaped text area that is written with css, it looks great until I write more than the area can fit when I do this, when the scroll bar appears, and that scroll bar looks awful with my dark style (it is black with white text). So how would I do this? I searched for some of them, but did not find a good answer, I just found all these changes only for IE.

+2
source share
4 answers

You can use this script http://studio.radube.com/html-textarea-custom-scrollbar and get a personalized text scrollbar.

+1
source

@handsofaten: jScrollPane does not work with textarea elements because it dynamically adds div elements to the contents of the element to which you applied it. You cannot add div elements to a text box.

It would be possible to add a wrapper element to the text box and apply a scroll bar to this parent element. I would not recommend this because when you add text to a text field, their content grows, not the text area itself. You will have to apply a hack to the text field so that it grows with its contents. This probably leads to erratic disorder.

So, I would let go of the idea.

By the way: Webkit (Chrome, Safari) also supports a proprietary way to style CSS scrollbars: http://webkit.org/blog/363/styling-scrollbars/

+2
source

Check out this jQuery plugin: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html

I found out about this from this site, where you can see it in action on the TribWire sidebar: http://www.texastribune.org/

+1
source

You can also check out http://www.css3.com . Click SCROLLBAR ... in the list. If it will work or not, I do not know. CSS3 is not yet supported in browsers, but I hope it will be in the future.

0
source

Source: https://habr.com/ru/post/895148/


All Articles