How to disable the resizable property of a textarea
Short article on how to disable the resizable property of a textarea using CSS property resize.
In this article, we will see quick ways to disable the resizable property of a textarea using CSS.
In CSS, we can disable it using the resize property. Set resize to none in textarea HTML element.
textarea{ resize: none; }
This will disable the resize property from all the textarea on your website or web page.
However, if you want to disable it only on a few textareas, then you can set a class or id and then use the resize: none on those classes or ids.
<u>Using a class:</u>
<textarea class="textarea1"></textarea>
.textarea1{ resize:none; }
<u>Using an id:</u>
<textarea id="text-area"></textarea>
#text-area{ resize:none; }
<u>Using name attribute:</u>
You can also disable a specific textarea using the name attribute.
<textarea name="text-area"></textarea>
textarea[name=text-area] { resize: none; }
Related Posts
How to create a horizontal list using HTML and CSS
Find out different ways to create horizontal list using inline-block and flex-box in CSS for your navigation bar on your website.
How to use calc() in tailwind CSS
Learn the use of calc() in tailwind CSS class. The calc() CSS function allows complex calculations to determine element sizes responsively.
Vertically Center Align a div in Tailwind CSS
Learn how to vertically center align a div in Tailwind CSS using Flexbox and absolute positioning and make your web development more efficient and fast.
Create a vertical line using Html and Css
Learn with step-by-step instruction on how to add vertical line in HTML using CSS border, transform and pseudo classes.
