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

303
Views
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
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!