--

Nice solution. I've been using just <div className="top-1/2 translate-y-[-50%] absolute transform">{content to overlay}</div> to get the same effect. I haven't been able to figure out a good solution to replicate the CSS background parallax effect, and background-repeat with dynamic sized layouts is also tricky at times.

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

Responses (1)