1

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?

3 Answers 3

3

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>
Sign up to request clarification or add additional context in comments.

Comments

1

Have you linked the stylesheet in your page?

Comments

0

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>

1 Comment

good point, however, the cssclass property would still have a value, it just wouldn't work.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.