如何在<select>标签中呈现自定义字体?</select>

时间:2012-04-26 08:03:12

标签: html asp.net-mvc-3 fonts

我想在我的一个页面(MVC 3)中使用一组自定义字体(不是系统字体)。我想在<select>标签中显示这些字体,但是可以将每个元素中的文本呈现为其字体样式吗?

换句话说,我想渲染例如字体enter image description here

在其中一个选择标签项

1 个答案:

答案 0 :(得分:3)

是的你在CSS中声明它是这样的:

 @font-face { font-family: urfont; src: url('urfont.otf'); } 
 @font-face { font-family: urfont; font-weight: bold; src: url('urfont.otf');}

然后,您可以像其他标准字体一样引用它:

<select style="font-family: urfont, sans-serif;"
相关问题