views:

133

answers:

3

Ive tried to create a stylesheet, its looks like this

.MyStyle
{ 
    /* IE6/7/8 - Must be first */   
 @font-face {   
   font-family: yourFontName ;   
   src: url( ~/fonts/Heidelbe-Normal.eot );   
  }

 /* FFx3.5/Safari/Op10 - Next */   
 @font-face {   
   font-family: yourFontName ;   
   src: url( ~/fonts/Heidelbe-Normal.ttf ) format("truetype");   
 }   

}

I then thought I could use the stylesheet by choosing it as a CssClass property on on my labelcontrol. But the CssClass property list is empty. What have i done wrong?

A: 

Did you refrence the stylesheet before using it ?

this is how you do it inside the head :

<link href="nameofthestylesheet.css" rel="stylesheet" type="text/css" />

and your lable must have the CssClass property

<asp:Label runat="Server" id="someid" CssClass="MyStyle" >some text</asp:Label>
Yassir
good point, however, the cssclass property would still have a value, it just wouldn't work.
DevelopingChris
+1  A: 

Have you linked the stylesheet in your page?

rdkleine
+3  A: 

If you have a label control on your page.

Set the cssclass property on it in the markup.

<asp:Label runat="Server" id="MyCrazyFontLabel" CssClass="MyStyle" >Hello world</asp:Label>
DevelopingChris