开发者

HTML textarea min-width ignored when width is set

The min-width seems to be ignored, I cannot scale les开发者_开发技巧s than 200px;

Any workaround?

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


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜