Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the resize corner from a textarea element? [duplicate]

Tags:

html

css

I am creating a simple text editor - the text input is a textarea element. I want to remove the two lines used to change the box size (in fact, if possible, I'd like to fix the box size so it can't be changed).

This is what I'm talking about: enter image description here

EDIT: Here's the code:

// HTML
<textarea id="canvas" placeholder="Write something..."></textarea>

// CSS
#canvas {
  border: 1px dashed #999;
  background: transparent;
  width: 500px;
  height: 400px;
  margin: 0 auto;
  padding: 5px;
  font-size: 20px;
}
like image 204
tbd_ Avatar asked Oct 31 '25 10:10

tbd_


1 Answers

You can try CSS properties resize and appearance:

#textbox {
    border: 1px dashed #999;
    background: transparent;
    width: 500px;
    height: 400px;
    margin: 0 auto;
    padding: 5px;
    font-size: 20px;

    resize:none;

    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}
<textarea id="textbox" placeholder="Write something..."></textarea>
like image 108
Bharata Avatar answered Nov 02 '25 01:11

Bharata