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

295
Vistas
mediaQueries properties in css is not working in reactJS?

I am learning reactjs and encountered a problem while displaying the properties in media queries. What I am trying to do is to display the hamburger I built using CSS.

  • For width > 799px : It should NOT be displayed i.e. display:none
  • For width <= 799px : It should be displayed i.e. display:block

Attached CSS files

When width>799px;

/* hamburger menu */
.header .headerContainer_hamburgerMenu {
 display: none;
 background-color: var(--font-color);
 height: 2px;
 width: 1.2rem;
 cursor: pointer;
 margin-right: 1rem;
 } 

.header .headerContainer_hamburgerMenu::before, .header .headerContainer_hamburgerMenu::after {
  content: "";
  background-color: var(--font-color);
  height: 2px;
  width: 1.2rem;
  cursor: pointer;
  display: block;
 }
 .header .headerContainer_hamburgerMenu::before {
    transform: translateY(-7px);
  }
 .header .headerContainer_hamburgerMenu::after {
    transform: translateY(5px);
  }
  • when width<799px:

     @media only screen and (max-width:799px) {
    
     .header .headerContainer_hamburgerMenu {
         display: block;
        }  
     }
    

On inspecting element, I got this

insoect element

I am also attaching the picture of the hamburger

enter image description here

I also intentionally displayed the hamburger for the desktop view to show you where I want this in the navbar in the given pic

enter image description here

about 4 years ago · Juan Pablo Isaza
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