I am trying to apply css class style to my @Html.TextBoxFor control in mvc3 razor view. But I am not able to see the defined style applied to the control. Below is my code:
In my .cshtml file I have the control as:
@Html.TextBoxFor(model => model.project.ProjectName, new { @class = "myStyle"})
In .css file I have defined the style as:
.myStyle
{
width: 150px;
font-family:Arial, Helvetica, sans-serif;
font-size: 1.00em;
}
What am I doing wrong? Can anyone help me please?
Thanks, Balaji
class="myStyle"? Or is there a possibility the CSS file is missing?<input type="text" class="myStyle" />to see if takes the style...background-color: #F00;(just in case). You could "inspect" elements with firebug or chrome to check html/css rendering