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

171
Vistas
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 Respuestas
Responde la pregunta

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 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