Search code examples
cssbrowsertextarearesizable

Text Area For - non re-sizable


I have the follwing mark-up in my cshtml file. However the textbox area has a dragable corner in the bottom left corner that when dragged re-sizes the text area and affects all other text boxes/drop downs etc on the page.

            <td class="label">
                Notes :
            </td>
            <td class="value" rowspan="3">
                @Html.TextAreaFor(model => model.Notes, new { cols = "40%", style = "width:250px;", @maxlength = "255" })
            </td>

Is there anything I can add to disable the textareafor from being resizeable?


Solution

  • The trick is in the css resize:none:

    use :

    @Html.TextAreaFor(model => model.Notes, new { cols = "40%", style = "width:250px;resize:none", @maxlength = "255" })