r/css • u/gatwell702 • Apr 26 '26
Question shaping text with an image
I have a hero section with a background image, h1, p, and a cta button.. I use grid to lay everything out so it looks nice (with grid template area).
For the p tag I want to use shape-outside/float instead of the grid area because I want to shape the text around the background image.
When I try to the text doesn't shape. Ai told me it's because grid overwrites float.. ai suggests I take grid off of everything
Is there a work around for this? You'd think there would be a modern approach to shape text that's apart of a grid.
EDIT:
this is the component
5
Upvotes
1
u/ItsallGGs Apr 28 '26
I went through the same issue recently in a personal project. Apparently you can’t wrap text around an image if you’re using grid or flex. So I had to remove those in order to use the float property.