Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textarea resize vertical in ie

Tags:

css

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?

like image 735
user983208 Avatar asked Mar 15 '12 01:03

user983208


People also ask

How do I Auto Resize textarea?

# Auto Resize a `<textarea>` with an `autosize` Attribute First, a regular `<textarea>`. <textarea>Will NOT auto resize. </textarea> Now add an attribute to tell the element to automatically resize on input, i.e. `<textarea autosize>`. <textarea autosize>Will auto resize.

How do I make a textarea not resizable?

A simple way to ensure that the control is not resizable is to add an explicit style="resize: none;" attribute on the textarea element using the HTML Form Element Attributes property.

How do you make a textbox resizable?

Resize a text box Select the text box. Select one of the handles and drag until the text box is the size you want.

How do I fix my text area?

How do you make a text area a fixed size? 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.


1 Answers

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;
}
like image 132
T. Junghans Avatar answered Nov 22 '22 02:11

T. Junghans