Applying Styles to @Html.TextboxFor in ASP.NET MVC | ASP.NET MVC Tutorial

We can Apply CSS class to @Html.TextboxFor in ASP.NET MVC. An overload of the TextBoxFor method allows you to pass an object for the HTML attributes as given below:

@Html.TextBoxFor(m => m.EmployeeName, new { Class="YourBackgroundClass" })
Then you can have a CSS rule such as:
.YourBackgroundClass { background:#cccccc; }
If you want to apply a style directly you can do:
@Html.TextBoxFor(m => m.EmployeeName, new { Style="background:#cccccc;" })