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

158
Vistas
How to set the background image in react js using external css?

I am trying to set the image in the background of the container via external css , but it says modules not found ,what is the correct path I should give in background-image....


     import React from 'react'
import './Login.css'
const Login = () => {
    return (
        <>
        <div className="container-fluid img-wrapper bg-danger">
        </div>
        </>
    )
}
export default Login

  *{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
     .img-wrapper{
        background-image:url(../public/login-bg.png);
        background-position: center center;
        background-size: cover;
        background-repeat: no-repeat;
        height:100vh;
    }



    
     
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It looks like you are facing the same issue as in this question: Use images in CSS files with ReactJS

You can add the photo to your public folder, since the server is served there. As provided in this Codesandbox: https://codesandbox.io/s/agitated-turing-gsnr3?file=/src/styles.css

about 4 years ago · Juan Pablo Isaza 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