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

665
Views
No se puede colocar una imagen de fondo en el siguiente JS y Tailwind CSS

Estoy atascado y no puedo colocar la imagen de fondo en mi próxima aplicación JS.

Aquí está mi código.

globals.css

 .container { padding: 0 2rem; background-image: url(../public/images/landing-page-illustration.svg); }

index.js

 import Head from 'next/head' import Image from 'next/image' import Navbar from '../components/navbar'; import styles from '../styles/Home.module.css' export default function Home() { return ( <div className={styles.container}> <Navbar/> </div> ); }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Solo necesitas hacer esto. Esto funciona para mi. Actualice la clase de viento de cola con su css.

 <div className="relative"> <!--position: 'relative' --> <Image src="image path" layout="fill" objectFit="cover" /> <div className="w-full relative"><!-- position: 'relative' --> <h2 className="text-center font-semibold text-4xl pb-8 pt-14 text-pink-600">hello</h2> </div> </div>

La altura del fondo aumentará según el contenido. Puede fijar la altura por

altura: '80vw'

about 4 years ago · Juan Pablo Isaza Report

0

También me atasqué en este problema, luego usé las next-images y declaré esto en el archivo jest.config.js de esta manera:

 module.exports = { async redirects() { return [ { ... }, ]; }, reactStrictMode: true, future: { webpack5: true }, images: { domains: ['https://...'], }, }; const withImages = require('next-images'); module.exports = withImages();

y solo usé la <img /> para representar la imagen

 <img src={Wave} style={{ zIndex: -1, width: '100%', position: 'absolute', }} className='md:bottom-px origin-center rotate-180 md:rotate-0 ' alt='' />
about 4 years ago · Juan Pablo Isaza Report
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!