I have a css file mainPageStyle.css, with the selector logo:
.logo{
position: absolute;
left: 3%;
border-radius: 5%;
}
I have another css file landingPageStyle.css, with the selector logo, but more specific:
.container .content .logo {
width: 21em;
}
.container .content .logo img {
width: 40%;
height: 40%;
border-radius: 5%
}
In my login.jsx, I import only the landingPageStyle.css and used the logo class as follow:
<div className="logo">
<img src={myLogo} alt="login"/>
</div>
The image will apply both of the styles in the logo selector. How could this happen? I just want the logo defined in the landingPageStyle.css.
I see I could solve this issue by renaming 1 of the logo selector, or we can be more specific with the selector in css. But how can we use the same classname? Why the login.jsx can use the style in logo from mainPageStyle.css without importing?