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

169
Views
grid-template-columns is not working in React 18

Major Update to the Question(7th May): When I am using my arrow keys, I could see all of the three cards but still the same is as big as it doesn't fit on the screen.

 <div className="container portfolio__container">
      {
        data.map(({id, image, title, github, demo}) => {
          return (
            <article key = {id} className="portfolio__item">
          <div className="portfolio__item-image">
            <img src={image} alt={title} width="480" height="360" />
          </div>
          <h3>Chat App using React and Socket</h3>
          <div className="portfolio__item-cta">
            <a
              href={github}
              className="btn third about-btn"
              target="_blank" rel="noreferrer"
            >
              Github
            </a>
            <a
              href={demo}
              className="btn third about-btn"
              target="_blank" rel="noreferrer"
            >
              Live Demo
            </a>
          </div>
        </article>
          )
        })
        }
      </div>

This is part of the portfolio.jsx code in which portfolio container and container class has been used.

.portfolio__container{
    display: grid;        
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: 2.5rem;
}

This is the portfolio__container class used in portfolio.css and

.container{
    width: var(--container-width-lg);
    margin: 0 auto;
}

This is the container class used in index.css

:root{
    --color-bg: #1f1f38;
    --color-bg-variant: #2c2c6c;
    --color-primary: #4db5ff;
    --color-primary-variant: rgba(77,181,255,0.4);
    --color-white: #fff;
    --color-light: rgba(255, 255, 255, 0.6);

    --transition: all 400ms ease;
    

    --container-width-lg: 75%;
    --container-width-md: 86%;
    --container-width-sm: 90%;
}

I am using react 18 and the output shows like this:

Output I am getting

the desired output:

desired output

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The answer to this question seems to be very simple and unexpected.

If we simple reduce the size of the buttons used on the portfolio container, the work is done.

about 4 years ago · Santiago Trujillo Report
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!