DEV Community

Practicing Datscy
Practicing Datscy

Posted on

How to use fonts with <link> tag

In this post, short examples are shown for how to use two popular fonts using the HTML< link> tag.

Awesome fonts

<!DOCTYPE>
<html>
<head></head>
<body>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css">


<i class="fas fa-robot">  Robot &#xf544</i>
<br>
<i class="fas fa-laptop">Laptop &#xf109 </i>


<div id="output"></div>

<script>
</script>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

The output is the following, where the boxes are where the fontawesome icons and its unicode version are printed.
 Robot 
 Laptop 

Google fonts

<!DOCTYPE>
<html>
<head></head>
<body>

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine">

<h3 id="h3_text">Using Google fonts!</h3>

<style>
  #h3_text {font-family: "Tangerine"; font-size: 35px;}
</style>
<script>

</script>

</body>
</html>
Enter fullscreen mode Exit fullscreen mode

Good Luck and Happy Practicing! 👋

💻 GitHub | 🌷 Practicing Datscy @ Dev.to | 🌳 Practicing Datscy @ Medium

References

  1. Google fonts: https://developers.google.com/fonts/docs/getting_started?hl=en

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay