Chrome : make non resizable textareas

Google ChromeTextareaFirefox4

Google Chrome Problem Overview


By default, Chrome makes my textareas resizable. I wish to control this and either make them only vertically resizable, or not at all.

How can I achieve this ?

Google Chrome Solutions


Solution 1 - Google Chrome

Rails generate standard textarea tag, but Safari/Chrome (Webkit) display all (not only Rails :) textareas as resizable.

Its apperance may be disabled by CSS

textarea {
    resize: none;
    }

Or, if need only vertical resize:

textarea {
     resize: vertical;
     }

Solution 2 - Google Chrome

Set max-width to make them only vertically resizable, or set max-height and max-width to stop all resizing.

However, be aware that breaking user expectations about how their browser treats controls tends to create a lot of user frustration.

Solution 3 - Google Chrome

you can set the column and rows like

<%= text_area :object, :attribute, :rows => '10', :cols => '100' %> 
#=> <textarea cols="100" rows="10" id="object_attribute" name="object[attribute]">
#      #{@object.attribute}
#   </textarea>

or specify the size like

<%= text_area :object, :attribute, :size => "10x100" %> 
#=> <textarea cols="10" rows="100" id="object_attribute" name="object[attribute]">
#      #{@object.attribute}
#   </textarea>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionglmxndrView Question on Stackoverflow
Solution 1 - Google ChromeingeniariusView Answer on Stackoverflow
Solution 2 - Google ChromejballView Answer on Stackoverflow
Solution 3 - Google ChromenasView Answer on Stackoverflow