title: How to import Google Fonts to HTML/CSS?
body: <p>I can't get the <a href="https://fonts.google.com/specimen/Roboto" rel="nofollow noreferrer">Roboto</a> font to work in my HTML file. If I understand correctly, Google's instruction are:</p>
  <p>&quot;Copy these lines into your <code>head</code> tag&quot;:</p>
  <pre><code>&lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.googleapis.com&quot;&gt;
  &lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.gstatic.com&quot; crossorigin&gt;
  &lt;link href=&quot;https://fonts.googleapis.com/css2?family=Roboto:wght@100&amp;display=swap&quot; rel=&quot;stylesheet&quot;&gt;
  </code></pre>
  <p>This is my HTML:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;link rel="preconnect" href="https://fonts.googleapis.com"&gt;
      &lt;link rel="preconnect" href="https://fonts.gstatic.com" crossorigin&gt;
      &lt;link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100&amp;display=swap" rel="stylesheet"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h3&gt;This is a heading&lt;/h3&gt;
      &lt;p&gt;This is a string.&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Instead of the Roboto font, the website shows the standard font:</p>
  <p><a href="https://i.stack.imgur.com/yKhOH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yKhOH.png" alt="enter image description here" /></a></p>