Import a Google Font in css

While we can import a google font by link method, how do we import by import method?

1 Like

Hello @Aryankapoor. You should not import google fonts using the @import method as it has a major performance issue and can slow down your project. I always use the link method and I recommend others to use it.
If you want to use the import method, you can do it by selecting @import tab in Google Fonts while selecting the font family. There you will get the CSS code.
Happy Coding!

1 Like

I am using the google font in a codepen project and I have a very long html code, I cannot go any longer. I need to use the import method

1 Like

That was why I was asking, btw thanks

1 Like

You have an option to put the link tag inside the head tag in CodePen by clicking on the settings icon at the top of the HTML code box and then paste the link code inside the "Stuff for <head>" box.

1 Like

ok, that is a lifesaver

1 Like