Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimum height needed in textarea for draggable resize

Tags:

html

css

textarea

I have a textarea on my page. It has this draggable corner which lets me resize it. Like in this screencrop below

enter image description here

If I resize it too small, the corner will disappear (even though the corner will still let me resize the textarea).

I want to place the minimum height to whats needed for it to display the draggable corner image so not as to confuse users

What would this minimum-height required be? Do stuff like padding and margin affect it? Is it only in Chrome or is it the same in Safari/IE.. etc?

like image 395
Tarang Avatar asked May 27 '12 09:05

Tarang


People also ask

How do I limit the height of a textarea?

To prevent a text field from being resized, you can use the CSS resize property with its "none" value. After it you can use the height and width properties to define a fixed height and width for your <textarea> element.

How do I change the minimum height of a textarea in HTML?

To set the height, you would use the height property, as in your example, and/or the rows attribute, which indirectly sets the height. As usual, it sets the content height. The total height of a textarea box is content height plus top padding plus bottom padding plus top border plus bottom border.

Is the attribute used in textarea to control the size of the height?

The rows attribute specifies the visible height of a text area, in lines. Note: The size of a textarea can also be specified by the CSS height and width properties.


1 Answers

You should be able to define in the element cols and rows. Like Doing this creates the minimun size. Then you can resize from there. OR in CSS

In CSS you could do min and max sizes. Safe for most modern browsers

  #confinedSpace textarea { resize:vertical; max-height:300px; min-height:200px; }
  #confinedSpace textarea.horiz { resize:horizontal; max-width:400px; min-width:200px; }
like image 79
Alex Reynolds Avatar answered Nov 02 '22 11:11

Alex Reynolds