I want my textarea to have a fixed width

33,482

Solution 1

textarea {
  resize: vertical;
}
<textarea cols="10" rows="5" charswidth="23" name="text_body"></textarea>

JSFiddle Demo

Solution 2

This can be achieved via CSS.

    <textarea cols="10" rows="5" charswidth="23" name="text_body" style="resize:vertical"></textarea>
Share:
33,482
Stephinext
Author by

Stephinext

I am a passionate programmer who aims at tearing apart the masks of obscurity and demons of programming so I can see the wide sky.

Updated on August 05, 2022

Comments

  • Stephinext
    Stephinext almost 2 years

    I have seen it on some sites where the textarea input can by drawn only downward but not to sideways.

    <textarea cols="10" rows="5" charswidth="23" name="text_body"></textarea>
    I have tried those but the width is still extendable. Please how can I do this?