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

451
Vistas
Adding a background image link to a div class using tailwind css framework

I'm trying to add a link for a background image using tailwind css syntax. The project.pic is a string of a link saved on imgur. If I use an img tag and the src attribute, the image loads. I would like to use the div I have set up. I've tried the 3 options below without any success. How can I pass the imgur path to the bg-[url(path)] correctly?

project.pic = 'https://i.imgur.com/JdgrfD5.png'

<div class="bg-[url(<%= project.pic %>)] bg-center bg-no-repeat bg-cover h-[40vh]">
</div>
<div class="bg-[url("<%= project.pic %>")] bg-center bg-no-repeat bg-cover h-[40vh]">
</div>
<div class="bg-[url('<%= project.pic %>')] bg-center bg-no-repeat bg-cover h-[40vh]">
</div>
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