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>
and I get this error
The name 'font' does not exist in the current context
In your VS code editor Go to File > Preferences > settings and search font. Insert the name of the newly downloaded font("Fira Code") before other default fonts and voila!!
Start with the font you want, and always end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available. Note: Separate each value with a comma. Note: If a font name contains white-space, it must be quoted.
<style type="text/css">
@@font-face
{
font-family: 'Dense';
src: url('Dense-Regular.ttf');
}
.classname
{
font-family: 'Dense';
}
</style>
Cancel @ character. It is a custom character for mvc. To use it inside css use it as @@.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With