8

How do i resize my textarea vertically in IE?

I did resize: vertical and it works well in Firefox but in IE it doesn't work. So what's the alternative for this?

Also, if I want to print the page, then I need the textarea to extend and print the whole contents in the box. What should I use for this?

edited -

My CSS:

@media screen {
    textarea {
        resize: vertical;
        overflow: auto;
        border: 1px #999999 solid;
        padding: 6px;
        background: #ffffff url('../images/field_bg.png') repeat-x bottom;
        width: 400px;
        height: 100px;
    }
}
@media print {
    textarea {
        border: 1px #999999 solid;
        padding: 6px;
        background-color: #ffffff;
        background-image : none;
        width: 400px;
        height: auto;
        overflow: visible;
    }
}
.field {
    display: inline;
    vertical-align: top;
    width: 25%;
}

HTML -

<div class="field">
<textarea id="xp">
some text here
</textarea> 
</div>

Edited -

I still can't figure out the solution for this. Can anybody help please?

user983208
  • 235
  • 2
  • 4
  • 9

2 Answers2

11

The css resize property is not (yet) supported by IE. You may want to try this jquery ui plugin: http://jqueryui.com/demos/resizable/. Here's a fiddle to demonstrate.

For your second question regarding printing in IE. Try add the following CSS to the media="print" block:

textarea {
    overflow: visible;
}
T. Junghans
  • 11,385
  • 7
  • 52
  • 75
  • perfect works well in ff,safari. but in IE it falls down to next line line even with display:inline-block. FF,safari responds to this but IE still stands on next line. wat to do??? – user983208 Mar 19 '12 at 00:45
  • And the second solution works properly in FF. but in safari,IE it is still has this problem. wat could be the reason?? :( – user983208 Mar 19 '12 at 01:02
  • Does this still hold true for IE ? – Ankur Marwaha Oct 31 '18 at 09:09
0

I'm not sure but as i know Internet Explorer doesn't support that. You can use javascript for that. Here is a jquery plugin similar to this textarea i'm typing now : http://archive.plugins.jquery.com/project/TextAreaResizer

draconis
  • 458
  • 5
  • 16