Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
Why CSS-Modules is affecting globally when working with html elements?

I have a file mycomponent.module.css

button {
    width: 10vw;
    min-width: 150px;
}

Unfortunately this css is affecting globally instead of the specific component where I am importing it. Does CSS modules not work on element names and only works on class-names? So .button instead of button?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If you want to style a current button, you should give a className or Id to your button. In this case it was global, for all butons.

about 4 years ago · Juan Pablo Isaza Report

0

Write like this.

Make a Class or ID and call them where is needed.

.bu{
    width: 10vw;
    min-width: 150px;
    background-color:red;
}
<button class="bu">button1 </button><br><br>
<button>button2 ! </button>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!