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

235
Vistas
properly importing/applying CSS files into react to utilize full screen view

codesandbox attached. I had to fork a piece from my other code to get the current behaviour: https://codesandbox.io/s/compassionate-leavitt-cssformatting-p10w5

I'm learning how to properly utilize CSS files in my reactJS project, as I'm trying to utilize the full view port in components, to make the page content scale with page size. At the moment, I've got a problem of the viewport for Body, not restricting my other components from using that viewport as a base.

CSS file is pretty simple:

CSS content

Use body at 100%, and if there is 1 grid, use 100% of the viewport, if 2, half a viewport each.

In index.js, I'm importing the css via import "../cssfile.css" same in the component that generates the grids. There is a bit of layering, as different components generate inside others, and the one that generates the grids, is, eventually, the one that generates the very bottom of the structure. Here is how the body displays:

body top body bottom

then here is the components display. Notice the top components are offset, and only the grids have the viewport scaling applied to them.

top grid bottom grid

Do I need to apply the CSS differently somehow, or parent the elements to body somehow for it to utilize the body/html 100% height size?

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