我正在使用以下代码显示一些文字,它不会改变字体颜色,任何人都知道为什么?
<%= Html.TextAreaFor(m => m.Component.ApplicationDescription, new { cols = "40%", Style = new Style { ForeColor = Color.Red } })%>
答案 0 :(得分:11)
<%= Html.TextAreaFor(m => m.Component.ApplicationDescription,
new { cols = "40%", style = "color:red;" })%>
或应用css样式:
<%= Html.TextAreaFor(m => m.Component.ApplicationDescription,
new { cols = "40%", @class = "foo" })%>
看起来像这样:
.foo {
color: red;
}