4

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; } 
2
  • show your code please Commented Jul 5, 2018 at 7:48
  • Edited from 'canvas' to 'textarea' : ) Commented Jul 5, 2018 at 8:15

2 Answers 2

7

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>

Sign up to request clarification or add additional context in comments.

1 Comment

Excellent, thank you!
4

Add the property resize:none to the textarea. Here is the working code:

#canvas { border: 1px dashed #999; background: transparent; width: 500px; height: 400px; margin: 0 auto; padding: 5px; font-size: 20px; resize:none; }
<textarea id="canvas" placeholder="Write something..."></textarea>

Hope this helps!

2 Comments

@tkim90 do tell me if anymore changes are needed
This is perfect, thank you!!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.