I am using DropDownList(), TextArea(), TextBox(), ListBox() in my aspx page. I want to apply External CSS to it not inline CSS. And I don't want apply using Id/Class. So How to apply External CSS to HTML helper Class Element by its name?
Asked
Active
Viewed 386 times
1
-
[See this SO question](http://stackoverflow.com/questions/5468766/can-i-apply-a-css-style-to-an-element-name) – von v. Apr 05 '13 at 10:55
-
This I know. But what about HTML Helper Class Elements? – IT_INFOhUb Apr 05 '13 at 10:58
1 Answers
2
controls added using HTML helper class converts the controls them to simple HTML elements/controls.
If you are adding Html.Dropdownlist()
it will get converted to <select/>
only at last.
So for this simply apply your css on the <select/>
.
and for future simply view PageSource from browser and you will come to know in which tag your control is getting converted and you can write your css for that tags...

blue
- 568
- 3
- 10
- 30