Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

135
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda