Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
how to write hover in same class in css file for react js

enter image description here enter image description here

This is a reactjs project, Te amperzand syntax is working fine in Javascript file but not in css.

How to write hover class in css file?

about 4 years ago · Santiago Gelvez
2 Respuestas
Responde la pregunta

0

You must write it this way

.baseStyle {
 /* base styles goes here*/

}

.baseStyle:hover {
/* hover styles goes here */
}

If you wish to attain what you intend you must use scss.

Then it will be like

.class {
    margin:20px;
    &:hover {
        color:yellow;
    }
}

Reference

  1. Using Scss in React
about 4 years ago · Santiago Gelvez Denunciar

0

If you want to write in same class. You should use Sass/Scss.

Save the css file with .scss extension. It is a precprocessor for better syntax.

Refer this sandbox:

https://stackblitz.com/edit/react-uwktzj?file=src%2FApp.js

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda