如何使每个页面在reactJS+;react路由器&x2B;创建react应用程序?

如何使每个页面在reactJS+;react路由器&x2B;创建react应用程序?,reactjs,react-router,Reactjs,React Router,我正在使用React和React路由器,并创建React应用程序,因此没有网页包 因此,我有一个index.js,它几乎路由我所有的组件,并导入react router,我的主要组件是app.js,因此在index.js中几乎路由如下,im也包括login.js路由 <Route exact={true} path="/" component={App} /> <Route path="/Login" component={Login}/> 我正在渲染一个有很多东西的

我正在使用React和React路由器,并创建React应用程序,因此没有网页包

因此,我有一个index.js,它几乎路由我所有的组件,并导入react router,我的主要组件是app.js,因此在index.js中几乎路由如下,im也包括login.js路由

<Route exact={true} path="/" component={App} /> 
<Route path="/Login" component={Login}/>
我正在渲染一个有很多东西的div

<div>
    stuff in here
</div>
因此,这在应用程序上非常有效,现在,当我添加一个类似的css文件进行登录时,所有内容都与app.css相同,但背景URL不同,背景会覆盖app.css上的背景

因此,login.css文件几乎覆盖了app.css文件中的所有css,在我看来,app.css和login.css在我将它们导入组件时都是全局的,它们被注入index.html的头部,并相互覆盖

有谁能分享一下如何阻止这种情况发生的直觉吗

<div>
    stuff in here
</div>
body, html{
  height: 100%;
  width:100%;
  font-family: 'Raleway', sans-serif;
  background-image: url("../images/app/app_background.JPG");
  background-repeat:no-repeat;
  background-position: center;
  background-size:cover;
  margin: 0;
}