css - How to style an asp control without using a separate CSSClass? -


i'm beginner in css , need set style asp:labels got in page. can html label control:

label {    color:red; } <label id="mylabel" runat="server">my text</label> 

but doesn't work asp:label control.

i find online can adding cssclass attribute each asp:label control , set attributes of cssclass @ top of page.

.myclass {    color:red; } <asp:label id="mylabel" runat="server" cssclass="myclass">test</asp:label> 

but way i'll have go through asp:label controls , give them cssclass="myclass". there way style asp:labels in same way styled html labels above?

the asp label renders span tag. try give style span tag.

label, span { color:red; } 

see here more information


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -