Eugene Sukhomlyn
Eugene Sukhomlyn

Reputation: 45

Custom font in ASP.NET MVC

I try to turn on custom font via _Layout.cshtml file

Here is code:

    <head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
<style type="text/css">
    @@font-face {
        font-family: "San Francisco";
        font-weight: 400;
        src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff");
    }

    .Text {
        font-family: "San Francisco";
    }
</style>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")

But my font is still Helvetica.I don't have any mistakes in dev console

Where is my problem?

Thank's for help!

Upvotes: 0

Views: 4333

Answers (1)

Eugene Sukhomlyn
Eugene Sukhomlyn

Reputation: 45

I found solution

I write this in CSS

@font-face {
        font-family: "San Francisco";
        font-weight: 400;
        src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff");
    }

and this

.mydiv {
font-family: San Francisco

}

after this just use this class in html.

Upvotes: 1

Related Questions