Welcome to WebmasterWorld Guest from 54.205.209.95

Forum Moderators: open

Message Too Old, No Replies

Textarea scrollbar doesn't disappear despite width:0

   
2:09 am on Apr 26, 2014 (gmt 0)

5+ Year Member Top Contributors Of The Month



No scrollbar in Chrome, but in Firefox and IE, it doesn't disappear although the element width is 0:
DEMO: [jsfiddle.net ]

What's the reason? What's a cross-browser solution so the textarea behaves like in Chrome?
3:14 pm on Apr 26, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



overflow:hidden seems to work, but it feels wrong. You'll almost certainly have to restore overflow:scroll when you want the box to be available to the user. I'd be more inclined to use the visibility property to toggle the element in and out.
3:46 pm on Apr 26, 2014 (gmt 0)

WebmasterWorld Administrator 5+ Year Member Top Contributors Of The Month



I looked at it yesterday but didn't post because I am not js/Ajax fluent, don't use a Chrome browser to check against.

..but in simple terms of css, the scrollbar comes from assigning a height of 200px to the textarea element. A width:0 wouldn't change that. If you remove the height attribute from the textarea css, the scrollbar disappears in FF. If you need that height for positioning, you might try to contain the form to a div with the 200px height setting.