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

297
Visualizações
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 à 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