DEV Community

Cover image for How To Use Google Fonts in web app🚀
venkateshpensalwar
venkateshpensalwar

Posted on

How To Use Google Fonts in web app🚀

As a new web developer, you want to use a different font sometimes so give a chance to Google Fonts it is a very big library for various fonts and I will show you how you can use it on your website.

You can you this Google font in 2 ways:

  1. include it in HTML.
  2. include it in CSS.

HTML:

  1. Go to website https://fonts.google.com/
  2. select any font you want and click on Get Font.

get font

  1. Then click on Get embed code.
  2. then copy the code for HTML and add your head tag in your HTML.

font code

CSS:

  1. After clicking on get embed code.
  2. Then click on the import radio button copy the code and add it to your CSS file.

include in css

After this, you can now use this new font in your styles in the following way

use font

Top comments (0)