Quick Tip: How To Disable Resizing of a Textarea in HTML or CSS

In this quick tip, we’re going to show you 2 different ways to disable the resizing of a textarea using CSS inline or not.


This content originally appeared on 1stWebDesigner and was authored by Editorial Team

In this quick tip, we’re going to show you 2 different ways to disable the resizing of a textarea, for those times when you don’t want the user to be able to control it in this manner. It’s a relatively quick process, with just some simple CSS using the resize CSS property.

Your Designer Toolbox Unlimited Downloads: 500,000+ Web Templates, Icon Sets, Themes & Design Assets

 

HTML

The HTML textarea element provides a resizable property by default. To disable it, you can use the CSS property resize: none in the textarea element. Here is an example:

 <textarea style="resize: none;"></textarea> 

CSS

You can also disable the resizable property of a textarea by using CSS that is not inline. You can add a class to the textarea element and then add the CSS property resize: none to the class. Here is an example:

<textarea class="no-resize"></textarea>

<style>
  .no-resize {
    resize: none;
  }
</style>


This content originally appeared on 1stWebDesigner and was authored by Editorial Team


Print Share Comment Cite Upload Translate Updates
APA

Editorial Team | Sciencx (2023-02-10T09:23:22+00:00) Quick Tip: How To Disable Resizing of a Textarea in HTML or CSS. Retrieved from https://www.scien.cx/2023/02/10/quick-tip-how-to-disable-resizing-of-a-textarea-in-html-or-css/

MLA
" » Quick Tip: How To Disable Resizing of a Textarea in HTML or CSS." Editorial Team | Sciencx - Friday February 10, 2023, https://www.scien.cx/2023/02/10/quick-tip-how-to-disable-resizing-of-a-textarea-in-html-or-css/
HARVARD
Editorial Team | Sciencx Friday February 10, 2023 » Quick Tip: How To Disable Resizing of a Textarea in HTML or CSS., viewed ,<https://www.scien.cx/2023/02/10/quick-tip-how-to-disable-resizing-of-a-textarea-in-html-or-css/>
VANCOUVER
Editorial Team | Sciencx - » Quick Tip: How To Disable Resizing of a Textarea in HTML or CSS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/02/10/quick-tip-how-to-disable-resizing-of-a-textarea-in-html-or-css/
CHICAGO
" » Quick Tip: How To Disable Resizing of a Textarea in HTML or CSS." Editorial Team | Sciencx - Accessed . https://www.scien.cx/2023/02/10/quick-tip-how-to-disable-resizing-of-a-textarea-in-html-or-css/
IEEE
" » Quick Tip: How To Disable Resizing of a Textarea in HTML or CSS." Editorial Team | Sciencx [Online]. Available: https://www.scien.cx/2023/02/10/quick-tip-how-to-disable-resizing-of-a-textarea-in-html-or-css/. [Accessed: ]
rf:citation
» Quick Tip: How To Disable Resizing of a Textarea in HTML or CSS | Editorial Team | Sciencx | https://www.scien.cx/2023/02/10/quick-tip-how-to-disable-resizing-of-a-textarea-in-html-or-css/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.