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

206
Vistas
How to insert backgroun image in card in react?

I want to insert an image as background in card.I have saved the image in public/img/login.png .The image isn't shown..I'm using coreui react admin template.This is my code ::

<CCard className="text-white bg-primary py-5 d-md-down-none " style={{ width: '44%' , backgroundImage: "url(/login.png)" }}>
  <CCardBody className="text-center ">
     <div>
        <h2>Sign up</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        <Link to="/register">
          <CButton color="primary" className="mt-3" active tabIndex={-1}>Register</CButton>
        </Link>
      </div>
    </CCardBody>
</CCard>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have created a assest folder inside of your root folder then you can add a images folder there and take the relative path and import it in the background image url.

import the image

import Yourimage from '../images/background_image.png';

var imgStyle= {
  backgroundImage: `url(${Yourimage})`
};

class ImgComponent extends Component {
  render() {
    return (

      <div style={imgStyle}>
      </div>
    );
  }
}
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