Home > Enterprise >  react pages css is getting mixed up even though in seperate folder for both pages
react pages css is getting mixed up even though in seperate folder for both pages

Time:04-06

I have 2 different pages sign-in and signup both are in separate folders with their own index.css(1 index.css for 1 page) but they are somehow using each other's CSS. if I make changes in one CSS file it also reflects on another page. I have imported them into their respective pages. I am kinda new to development.. please help.

CodePudding user response:

you should add a specific classname for each tag in your project same classes take same styles

CodePudding user response:

add class names in different files, not make them unique the best practice right now is to use CSS Modules. Check here for more info :

CSS Modules React document

with them, you can have the same name in different files, which react make them unique automatically

  • Related