0

im just a newbie on react. I created a simple app and when i try to include the .css file with the styles it just doesnt display anything, if i change the styles.css for App.css it displays the styles, however this way doesnt work. It dissapears everything, here is my code:

import React from 'react';
import logo from './logo.svg';
import './styles.css';


function Navigator(){
  return(
    <nav className="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav">
            <div className="container">
                <a className="navbar-brand js-scroll-trigger" href="#page-top"><img src="assets/img/navbar-logo.svg" alt="" /></a>
                <button className="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
                    Menu
                    <i className="fas fa-bars ml-1"></i>
                </button>
                <div className="collapse navbar-collapse" id="navbarResponsive">
                    <ul className="navbar-nav text-uppercase ml-auto">
                        <li className="nav-item"><a className="nav-link js-scroll-trigger" href="#services">Services</a></li>
                        <li className="nav-item"><a className="nav-link js-scroll-trigger" href="#portfolio">Portfolio</a></li>
                        <li className="nav-item"><a className="nav-link js-scroll-trigger" href="#about">About</a></li>
                        <li className="nav-item"><a className="nav-link js-scroll-trigger" href="#team">Team</a></li>
                        <li className="nav-item"><a className="nav-link js-scroll-trigger" href="#contact">Contact</a></li>
                    </ul>
                </div>
            </div>
        </nav>
  )
}

function App() {
  return (
    <div className="App">
      <Navigator />
    </div>
  );
}

export default App;

Can someone explain to me how i should include this files...

thanks!

Solar Confinement
  • 2,153
  • 3
  • 21
  • 28

1 Answers1

0

Try to import your css file in your html file instead. Or check the spelling of your file. You can also refer this

Krishna Sai
  • 181
  • 1
  • 1
  • 11