I want to disable the resizable property of a textarea.
Currently, I can resize a textarea by clicking on the bottom right corner of the textarea and dragging the mouse. How can I disable this?
|
|
The following CSS rule disables resizing behavior for
To disable it for some (but not all) To disable a specific
Or, using an
The W3C page lists possible values for resizing restrictions: none, both, horizontal, vertical, and inherit:
Review a decent compatibility page to see what browsers currently support this feature. As Jon Hulka has commented, the dimensions can be further restrained in CSS using max-width, max-height, min-width, and min-height.
|
|||||||||||||||||||||
|
|
In CSS ...
|
|||
|
|
|
I found 2 things first
this is a css3 which is not released yet compatable with Firefox4+ chrome and safari another format feature is to overflow:auto to get rid of the right scrollbar taking into account dir attribute code and different browsersBasic html
Some browsers
|
|||
|
|
|
CSS3 has a new propery for UI elements that will allow you to do this. The property is the resize property. So you would add the following to your stylesheet to disable resizing of all textarea elements:
This is a CSS3 property; use a compatibility chart to see browser compatibility. Personally, I would find it very annoying to have resizing disabled on textarea elements. This is one of those situations where the designer is trying to "break" the user's client. If your design can't accommodate a larger textarea, you might want to reconsider how your design works. Any user can add |
||||
|
|
|
|||
|
|
|
If you need deep support you can use old school technique
|
|||||
|
|
This can be do in html easy
This works for me. Default value is |
|||||||||||||
|
|
Adding !important makes it work:
outline is just to avoid the blue outline on certain browser |
|||||
|
|
CSS3 can solve this problem. Unfortunately it's only supported on 60% of used browsers nowadays. For IE and iOS you can't turn off resizing but you can limit the
|
||||
|
|
|
GREAT QUESTION! To disable the resize property, use the following CSS property:
|
|||
|
|
|
To disable resize for all textarea
To disable resize for a specific
CSS
|
|||
|
|
|
You can try with jQuery also
|
||||
|
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?