开发者

asp.net RequiredfieldValidator Error Message font color

On my webpage for a text box i have requiredfieldvalidator control which displays an error message when the textbox is empty. I can change the color using fore color property of the control dynamically on .cs page using RequiredFieldValida开发者_如何学Pythontor1.Style.Add("Color", "#0000FF");

how can i achieve the same using CSS i tried using

where .ErrorMessage { color: #0000FF; }

but i am still getting the font as red color and i cannot delete the forecolor property (cannot remove "red")

I cannot just put the color in the aspx page itself as this page is shared between different websites and has styles associated with it depening on the website displaying it.

Any help is appreciated.


You should be able to override it like this:

.validator {     
      color: pink !important; 
} 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜