Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

458
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!