I have code below that creates form with a Dropdown and edit. How can I set width for each individually.

@using (Html.BeginForm())
{
    <div class="form-horizontal" style="background-color:azure">
         <div class="form-group">
            @Html.LabelFor(model => model.EmployeeID, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("EmployeeID", null, htmlAttributes: new { @class = "form-control" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Description, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control" } })                
            </div>
        </div>
    </div>
}

I tried below , but it dosen't work.

 @Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control", style = "Width:250px"  } })

Related posts

Recent Viewed