Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow textarea re-size in lower-left corner

Tags:

html

css

Can I get the small re-size widget that appears in the lower right of text areas (on modern browsers) to appear on the lower left?

like image 217
Cory Kendall Avatar asked Sep 22 '12 00:09

Cory Kendall


People also ask

Can a textarea be resized?

In many browsers, <textarea> elements are resizable by default. You may override this behavior with the resize property.

How do I Auto Resize textarea?

# Auto Resize a `<textarea>` with an `autosize` Attribute First, a regular `<textarea>`. <textarea>Will NOT auto resize. </textarea> Now add an attribute to tell the element to automatically resize on input, i.e. `<textarea autosize>`. <textarea autosize>Will auto resize.

How do you make a textbox resizable?

Resize a text box Select the text box. Select one of the handles and drag until the text box is the size you want.


2 Answers

You can do that by setting writing direction to right-to-left. This implies that text is aligned to the right by default, but this can easily be overridden:

textarea { resize: both; direction: rtl; text-align: left; }

There are other side effects that you cannot override. The vertical scroll bar will appear on the left. The cursor will appear at the left at times (after typing in a directionally neutral character), even characters will appear on the right when typing only left-to-right characters intermixed with neutral characters – though directionally neutral characters first appear at the left (test with typing “abc (1) x” to see what I mean).

So it comes with features that are oddities when typing left-to-right text, and it’s better to look for a different approach to the original problem (whatever it was that made you want to put the resize handle in the lower left corner).

like image 54
Jukka K. Korpela Avatar answered Sep 28 '22 03:09

Jukka K. Korpela


CSS3 adds a "resize" property that allows you to control whether the textarea is resizable. But as far as I can tell, there's no property that specifies where the handle is. If you want that level of control, you'll have to implement the widget yourself with Javascript (similar to the way the jQuery Dialog widget adds a resize handle to the DIV it creates).

like image 36
Barmar Avatar answered Sep 28 '22 01:09

Barmar