I have a textarea
on my page. It has this draggable corner which lets me resize it. Like in this screencrop below
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?
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.
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.
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.
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; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With