skip to Main Content

These css font families are specified is usually under link tag code on right side of screen. These are to be defined in any css selector to decide the font family and get the content appear as it is in the google slide.enter image description here
refer to the image given to get my query.

I am trying to get the css style font family text there ( on google font website ), which will be used to define font family particularly given for that font to a content.

2

Answers


  1. you can use

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans"> 
    body {
        font-family: 'Open Sans', sans-serif;
    }
    

    … hope this might be helpful.

    Login or Signup to reply.
  2. In the "Selected Family" pane on right, you’ll see a section with the code to embed in your HTML/ CSS files to import a font.

    To use the tag, add the HTML tag to the section of your HTML file with the content to style.

    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap">
    

    Else, you can use @import selector on top of your CSS file to import fonts using the Google Font URL.

    <style>
    @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
    </style>
    

    Now in your CSS file, you can use the code under the section "CSS rules to specify families" as:

    /* Example CSS to apply the font family */
    body {
      font-family: 'Roboto', sans-serif;
      font-weight: 700;
    }
    

    As you can see, you will be able to specify font-weights too if the desired weights are also imported in the URL as shown:

    ‘https:// fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap’

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