Web DesignBrowsers, HTML

Textarea Scrolling in Firefox

1. Firefox will put a vertical AND horizontal scrollbar on a textarea by default.

To get rid of the horizontal scrolling, use this:

overflow-y: scroll; (or overflow-y: auto if you don’t want your scrollbar to appear if it’s not needed)
overflow-x: hidden;

Not this, as I’ve seen suggested on various blogs:

overflow: scroll;
overflow-y: scroll;
overflow-x: hidden;
overflow:-moz-scrollbars-vertical;

I’m not sure what the advantage is to the extra styles, as I’ve seen no difference in rendering.

2. Firefox will not wrap a single word. Use text with spacing for testing. I’ve made the mistake of testing with one long string of keyboard gibberish, and wondered why I could only get horizontal scrolling. Also, if you have your x-scrolling disabled, the string of characters that exceeds the width of the text box will be cut off from view.

Spaces are good.

Spaces are good

Single string is bad

Single string is bad

3. Be sure to set the height of the textarea great enough for the browser to render a scroll icon. If the textarea isn’t tall enough, all you’ll get is a gray box on the right hand side, which is still functional, but not intuitive.

With a specified height

With a specified height

Without a specified height

Without a specified height

Tags: , , ,

One Response to “Textarea Scrolling in Firefox”

  1. Dirnov says:

    Ugh, I liked! So clear and positively.
    Dirnov

Leave a Reply

“Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering”

—Master Yoda

I'm a web designer and writer based out of Nashville, TN, where I live with my husband, step-daughter, and chihuahua.

moonkatcreations at gmail dot com