Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the font & color when using Html.TextAreaFor?

I'm using following code to display some text and it won't change the font color, anyone know why?

<%= Html.TextAreaFor(m => m.Component.ApplicationDescription, new { cols = "40%", Style = new Style { ForeColor = Color.Red } })%>
like image 922
AwkwardCoder Avatar asked Dec 18 '22 00:12

AwkwardCoder


1 Answers

<%= Html.TextAreaFor(m => m.Component.ApplicationDescription, 
    new { cols = "40%", style = "color:red;" })%>

or apply a css style:

<%= Html.TextAreaFor(m => m.Component.ApplicationDescription, 
    new { cols = "40%", @class = "foo" })%>

which could look like this:

.foo {
    color: red;
}
like image 102
Darin Dimitrov Avatar answered Dec 28 '22 04:12

Darin Dimitrov