Use of CSS for controls (label, textbox, etc.)

J

Jurjen de Groot

I'm experimenting with StyleSheets in ASP.NET.

If I put a label on my webform and <LINK> the CSS file with the following
entries to the webform it doesn't work. It only works if I fill the property
'cssClass' of the label with the value 'label'.

..label
{
background-color: Red;
font-family: Verdana;
font-size: xx-large;
}

Isn't there some standard way of connecting classes (or whatever) to the
standard ASP.NET controls without having to fill the 'cssClass' property of
each and every control on the page ? Like using .label for labels or
..textbox for textbox controls ?


Kind regards,
Jurjen de Groot
Netherlands.
 
C

Curt_C [MVP]

that's because asp:Labels are read as INPUT by the css
try

INPUT
{
background-color: Red;
font-family: Verdana;
font-size: xx-large;
}
 
J

Jurjen de Groot

Curt,

Thanks for pointing me in the right direction, for labels one should use
'span' and for textbox you use 'INPUT'

Jurjen.
 
C

Curt_C [MVP]

My bad... you are correct...
Basically what I was shooting for is that you need to use the RENDERED html
tag type, not the asp type. :}

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top