0

i'm using react js for my project and i needed to use bootstrap in some pages of my application , so i put the <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> in the Public folder in index.html but that apply the bootsrap in all pages ..fontFamily has been changed in pages ..

i want to apply it for a specific react js file

how can i import <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> in a react js file please ?

thanks for your help .

Maryem Samet
  • 133
  • 1
  • 5
  • 23
  • 2
    https://stackoverflow.com/questions/34424845/adding-script-tag-to-react-jsx Have you seen this? – ageoff Aug 31 '18 at 14:20
  • Possible duplicate of [Adding script tag to React/JSX](https://stackoverflow.com/questions/34424845/adding-script-tag-to-react-jsx) – rmlan Aug 31 '18 at 14:21

1 Answers1

1

You can install bootstrap npm package

npm install bootstrap

and then import it in JS files

import 'bootstrap/dist/css/bootstrap.min.css';

The link below will help

How to use Bootstrap with React

prasanth
  • 61
  • 2