New May 17, 2026

Trying to build UI using react tailwind not able to figure out how to get he desired output [duplicate]

Libraries, Frameworks, etc. All from Newest questions tagged reactjs - Stack Overflow View Trying to build UI using react tailwind not able to figure out how to get he desired output [duplicate] on stackoverflow.com

I'm trying to build a UI where a large heading partially reveals an image inside the text while the remaining part of the image stays visible normally below the text.

expected output image

Layout idea:

I'll upload:

Need help refining the layering, masking/background-clip approach, and achieving a clean editorial-style overlap effect similar to modern portfolio websites.

Expected output:

enter image description here

Current output image is not getting inserted in text partially:

enter image description here

Code:

import profileImage from "../../assets/images/profile-image.png"

export default function HeroSection() { return ( <div className="relative flex-1 flex flex-col"> <Navbar /> <div className="bg-white pt-6 flex justify-center leading-none"> <div className="inline-flex flex-col items-stretch"> <span className="block ml-33 -mb-8 tracking-tight select-none text-xs font-bold text-zinc-600"> Creative <br /> Developer </span> <span className="block ml-95 -mb-10 tracking-tight select-none text-xs font-bold text-zinc-600"> Product <br /> Designer </span>

<span className="block tracking-tight z-6 select-none font-bold leading-none -mb-[0.17em] -mt-[0.1em] text-[clamp(80px,18vw,200px)] text-center from-[#4a4a4a] via-[#1f1f1f] to-[#000000] bg-clip-text text-transparent drop-shadow-[0_4px_12px_rgba(0,0,0,0.25)] " style={{ color: 'rgba(25, 30, 24, 0.75)' }} > Janice </span>

<div className="bg-cream overflow-hidden flex justify-end"> <img src={profileImage} alt="Janice" className="object-contain object-bottom block w-[75%] -mt-5 overflow-hidden z-5" style={{ maxHeight: '50vh' }} /> </div> </div> </div> </div> ) }

Scroll to top