本文介绍了如何在asp.net mvc 5中添加自定义字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在处理一个asp.net mvc5项目,我想向项目添加字体,我使用下面的代码,但是我没有得到正确的答案,我需要帮助。请帮助我
I am working on a asp.net mvc5 project and I want to add a font to project and I use below code but I dont get proper answer and I need a help .please help me
<style type="text/css">
@font-face
{
font-family: 'Dense';
src: url('Dense-Regular.ttf');
}
.classname
{
font-family: 'Dense';
}
</style>
我收到此错误
名称'font'在当前上下文中不存在
The name 'font' does not exist in the current context
推荐答案
<style type="text/css">
@@font-face
{
font-family: 'Dense';
src: url('Dense-Regular.ttf');
}
.classname
{
font-family: 'Dense';
}
</style>
取消@字符。这是mvc的自定义字符。要在CSS中使用它,请将其用作@@。
Cancel @ character. It is a custom character for mvc. To use it inside css use it as @@.
这篇关于如何在asp.net mvc 5中添加自定义字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!