12

I mean icons from fontawesome or fonts from google fonts. In HTML i place something like this in the head:

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

What about react?

1
  • 7
    you can place it in the head of index.html file Commented Jun 27, 2018 at 10:13

2 Answers 2

26

You can just import it in your style sheet like so

    @import url('https://fonts.googleapis.com/css?family=Roboto');

And your body style will become

body {
  font-family: 'Roboto';
}
Sign up to request clarification or add additional context in comments.

2 Comments

Is there any way to import it inside js extension reactjs because I am not using any css file instance use material-ui css
You can add it as link to your index.html should work correctly
4

inset the link in your index.html

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.