tags:

views:

19

answers:

2

The min-width seems to be ignored, I cannot scale less than 200px;

Any workaround?

<textarea style='width:200px; max-width:400px; min-width:100px'>
    text
</textarea>
+1  A: 

That's how it's suppose to work! The min-width and max-width properties should be used together to define a range of value for the element to resize to given the user's conditions (eg. monitor size). Explicitly giving the same element a width simply defeats this purpose.

See http://reference.sitepoint.com/css/min-width for more information

If you want a resizable textarea that grows with the amount of content the user adds you can have a look at this jQuery plugin: http://james.padolsey.com/javascript/jquery-plugin-autoresize/

Yi Jiang
I have a template that loads, but I want user to be able to change the size after loading...
selytch
what about scaling it down?
selytch
Eh... not entirely sure what you need here, but maybe this could help? http://jqueryui.com/demos/resizable/#textarea
Yi Jiang
How do you want the user to resize the textarea? By resizing their browser window, or by dragging a 'handle' on the bottom-right of the textarea (similar to how windows can be resized in an OS)?
Bobby Jack
dragging the handle
selytch
Thanks, resizable works great!
selytch
A: 

Thanks for Yi Jiang!

jqueryui.com/demos/resizable/#textarea

is the answer!

selytch