Link to home
Start Free TrialLog in
Avatar of WorknHardr
WorknHardr

asked on

MVC4 Editor Template TextBoxFor Width CSS Not Working?

I'm now using TextBoxFor instead of EditorFor so I can at least simplify the CSS.
I really want to set the CSS in the style sheet.
I'm beginning to wonder if Editor Templates are still a bit buggy...

This works locally!
   @Html.TextBoxFor(x => x.Amount, new { style="width:75px" })

This does NOT work using style sheet!
  @Html.TextBoxFor(x => x.Amount, null, "Amount" )
  @Html.TextBoxFor(x => x.Amount, new { @class = "amount" })

[Style Sheet]
 #Amount
    {
        width: 75px
    }

    .amount
    {
        width: 75px
    }
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Is the CSS style linked properly?
Avatar of WorknHardr
WorknHardr

ASKER

Do I need to place a style sheet link in the editor template?
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for helping...