I'm puzzled as to why my hero section file seems to be adopting the styling from the navbar CSS file. I do understand that the index.css file sets properties for the entire app, but in my case, I have separate CSS files for different components instead of using that one. A specific issue I've encountered involves the img
tag - where I've applied different styles in both hero.css and navbar.css files, yet somehow the hero.css file is picking up the properties defined in the navbar.css file's img
tag. Has anyone else experienced this problem, and if so, how did you resolve it?
This question isn't necessarily looking for a quick fix by renaming elements, but rather seeks to gain an understanding of why this cross-styling between CSS files is happening.