DEV Community

Ekrem Günden
Ekrem Günden

Posted on

2 2

Tailwind CSS and Next/Image Z-index not working

Image description

<div className="flex justify-between h-screen md:flex-row flex-col pt-64">
          ...
          <div className="z-50">
              <Image src="/Saly-14.svg" className="w-[916px] height-[1384px]" alt="" width={916} height={1384} />
          </div>
      </div>

<section className="bg-[#DBD9FF] z-30" id="services">
...
      </section>
Enter fullscreen mode Exit fullscreen mode

The name of this character is saly and even though I made it lower than the z-index of the section below, it still doesn't work. What could be the reason. Has anyone found a solution to a similar error before?

Top comments (1)

Collapse
 
designly profile image
Jay @ Designly • Edited

You should upgrade to NextJS 13. They completely reworked next-image and it doesn't use that stupid <span> wrapper anymore. I bet that would fix your problem. For more information, check out Vercel's Upgrade Guide.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️