skip to Main Content

I am currently doing a recipe project that requires a certain font and I don’t have the font and I am not sure how to go about getting it. The font style is called young serif I have a file with it but am unsure how to get it over to my visual studio.

2

Answers


  1. you have 2ways for adding Young Serif from Google Fonts either in the head of your HTML file by adding this code as indicated in Google Fonts

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Young+Serif&display=swap" rel="stylesheet">
    

    or by adding this code into your CSS file

    @import url('https://fonts.googleapis.com/css2?family=Young+Serif&display=swap')
    

    then to add the font in your class .myclass

    .myclass{
        font-family: "Young Serif", serif;
    }
    

    I Hope this help

    Login or Signup to reply.
  2. I use always google fonts. In visual studio, there is an extension called "Google Fonts Insert Link", that when you insert a font name (that exists, of course) it inserts the link to google fonts. In your case, young serif font link would be like this:

    <link href="https://fonts.googleapis.com/css?family=Young+Serif:regular" rel="stylesheet" />
    

    you have to insert the css code (in the Mehdi’s answer) to change the font-family.

    Hope this answers your question

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search