asp.net 2.0 themes and css

M

Mike P

If I am using themes for example on a label control, how do I also apply
css to the control? I have a number of label controls that I want to be
treated differently to my standard label controls by using an image for
their backgrounds.


Thanks,

Mike
 
S

Swanand Mokashi

You can define multiple <asp:Label> tags in a skin file with different
SkinId s -- then you can specify the SkinID for any asp:Label on your
webpage
 
E

Erik Funkenbusch

If I am using themes for example on a label control, how do I also apply
css to the control? I have a number of label controls that I want to be
treated differently to my standard label controls by using an image for
their backgrounds.

Set the CssClass property to whatever style you want to use.
 
C

clintonG

WRONG
Themes over-ride class declarations. The class declaration would have to be
applied to the Skin.

<%= Clinton Gallagher
 
E

Erik Funkenbusch

WRONG
Themes over-ride class declarations. The class declaration would have to be
applied to the Skin.

Perhaps I misunderstood, but I thought he was asking about applying a css
theme to a label control. If he means he's using a skin, then you're
correct.
 
M

Mike P

Here is my skin that relates to the label :

<asp:Label runat="server" Forecolor="#000000" Font-Names="Verdana"
Font-Size="9pt"
Backcolor="Silver" Font-Bold="True" SkinID="Main"
CssClass="Heading" />

Here is my css for the CssClass :

..heading {background-image: url(../images/titlegray.jpg);
color: black;
font-weight:bold;
font-family:Verdana;}

And here is the aspx page that I want to apply it to :

<asp:Label ID="lblLogin" runat="server" SkinID="Main">
Login</asp:Label>


This doesn't apply the CssClass to the label. Can anybody tell me what
is wrong with my code?
 
G

gerry

css classnames are case sensitive and are prefixed in the stylesheet with a
'.'

so either
CssClass="Heading"
.Heading{ .. }

or
CssClass="heading"
.heading{ .. }
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top