JavaScript - - By Craig Buckler

How to Remove Textarea Scrollbars in IE

This is possibly the quickest CSS tip I’ve ever posted, but who wants complex tutorials on a Friday! When you’re using a form textarea, Internet Explorer always shows a scrollbar even when it’s unnecessary…

IE textarea scrollbar

A scrollbar doesn’t appear in Firefox, Chrome, Safari or Opera. It’s pointless and a little ugly too — especially when the textarea is surrounded by standard input boxes. It never really bothered me: I just assumed that’s what IE did and never questioned it further.

The fix seems blindingly obvious now:


textarea
{
	overflow: auto;
}

It’s as simple as that. A scrollbar will only appear when the content in the textarea exceeds the space available. It works in IE6, 7 and 8 — view a demonstration.

Please accept my apologies if you’ve been doing this for many years, but it’s one of those useful little CSS tricks which must have passed me by! I hope it helps someone.

Sponsors
Login or Create Account to Comment
Login Create Account