2.0 themes and css

Discussion in 'ASP .Net' started by Mike P, Apr 4, 2006.

  1. Mike P

    Mike P Guest

    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.


    Mike P, Apr 4, 2006
    1. Advertisements

  2. 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
    Swanand Mokashi, Apr 4, 2006
    1. Advertisements

  3. Set the CssClass property to whatever style you want to use.
    Erik Funkenbusch, Apr 4, 2006
  4. Mike P

    clintonG Guest

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

    <%= Clinton Gallagher
    clintonG, Apr 4, 2006
  5. 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
    Erik Funkenbusch, Apr 4, 2006
  6. Mike P

    clintonG Guest

    Didn't mean to yell... %-)

    <%= Clinton Gallagher
    clintonG, Apr 5, 2006
  7. Mike P

    Mike P Guest

    Here is my skin that relates to the label :

    <asp:Label runat="server" Forecolor="#000000" Font-Names="Verdana"
    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;

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

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

    This doesn't apply the CssClass to the label. Can anybody tell me what
    is wrong with my code?
    Mike P, Apr 5, 2006
  8. Mike P

    gerry Guest

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

    so either
    .Heading{ .. }

    .heading{ .. }
    gerry, Apr 10, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.