在aspx StyleSheet.css中嵌入自定义字体

时间:2009-12-01 07:53:05

标签: asp.net css fonts

我正在尝试将StyleSheet.css的新字体嵌入

@font-face {
   src:url(../Font/HelveticaNeueLTStd-Lt.otf);
   font-family: "HelveticaNeueLight";   
   font-style: normal;
}




.helveticaclass{
    color: Red;
    font-size:12px;
    font-family: "HelveticaNeueLight";


    }

并适用于标签

    <asp:Label ID="Label1" runat="server" Text="My Custom Text Helvetica font" EnableTheming="false" class="helveticaclass" ></asp:Label>


And my style Sheet located in 

Root
|
|
CSS
   |
   |
   StyleSheet.css

字体位于

  Root
    |
    |
    Font
       |
       |
       HelveticaNeueLTStd-Lt.otf

但是我无法应用字体

任何解决方案或建议都非常赞赏

提前致谢

2 个答案:

答案 0 :(得分:2)

您可以查看此article,其中介绍了如何进行跨浏览器字体嵌入。

答案 1 :(得分:1)

@font-face {
   src:url(http://www.yoursite.com/font/HelveticaNeueLTStd-Lt.otf);
   font-family: "Helvetica Neue LT Std";   
   font-weight:bolder;
}

.whiteclass{
    font-family:"Helvetica Neue LT Std";
    font-weight:200;
    letter-spacing:1.4px;
    font-size:16px;
    color:#FFF;
    text-align:left;
}