- Back to Home »
- CSS , HTML »
Posted by : Jebastin
Sunday, 15 December 2013
We need to disable the re-sizable property of a TextArea. Normally, we can resize a TextArea by clicking on the bottom right corner of the TextArea and dragging the mouse. The following CSS is used to disable this behaviour.
Use the following CSS rule to disable this behavior for all TextArea elements:
Use the following CSS rule to disable this behavior for all TextArea elements:
- textarea {
- resize: none;
- }
If you want to disable it for some (but not all) TextArea elements, you have a couple of options (thanks to this page).
To disable a specific TextArea with the name attribute set to foo (i.e., <TextArea name="foo"></TextArea>):
To disable a specific TextArea with the name attribute set to foo (i.e., <TextArea name="foo"></TextArea>):
- textarea[name=foo] {
- resize: none;
- }
Or, using an ID (i.e., <TextArea id="foo"></TextArea>):
- #foo {
- resize: none;
- }