0

I have a textarea that can be resized by user. So I want this textarea to have a setted in css width&height as initial and maximum size. But width&height work like minimum size.

For example: http://jsfiddle.net/8t2E8/

width: 600px;
height: 200px;

Initial size is 600*200. I can make textarea only bigger, but need only smaller. Thanks for help.

Mudassir
  • 1,136
  • 1
  • 11
  • 29
GeraldIstar
  • 368
  • 1
  • 4
  • 16

3 Answers3

2

Try this example

textarea{
    width: 300px;
    height: 50px;
    max-width: 600px;
    max-height:200px;
    min-width: 300px;
    min-height: 50px;
}

Although, you should check this post :(

Community
  • 1
  • 1
Vivek Parekh
  • 1,075
  • 9
  • 25
  • 1
    Try setting the `width` and `height` so that they are greater than the `min-width` and `min-height`, you will see that `min-width` and `min-height` have no effect at all (tested in Chrome, Opera and Maxthon), only FF treats it differently. – King King Apr 11 '14 at 08:25
  • Well, it should have initial size same as maximum) – GeraldIstar Apr 11 '14 at 08:40
0
textarea{
    width: 600px;
    height: 200px;
    min-width: 300px;
    min-height: 100px;
}
ôkio
  • 1,772
  • 1
  • 15
  • 16
  • have you tested this yet? I had tested this before you posted this answer and it did not work. – King King Apr 11 '14 at 08:18
  • yes, looks like it works only in FF, does not work in Chrome, Opera and Maxthon (regardless of IE because IE does not support resizable textarea). – King King Apr 11 '14 at 08:23
0
textarea{
max-width: 600px;
max-height: 200px;
}
Aray Karjauv
  • 2,679
  • 2
  • 26
  • 44