r/csshelp • u/freew1ll_ • Jun 14 '23
Extend div width without moving text centerline?
Hi I have a div that I want to be wider than it's parent, but I don't want the text centerline to change. How can I do this?
Notice in this picture that the header is not inline with the text below because I have set the width to 120%:
2
Upvotes
View all comments
Show parent comment
1
u/freew1ll_ Jun 14 '23 edited Jun 14 '23
That does the trick, thank you so much!
I copied the style I was using for the background to the ::before element, and added these attributes:
and that solves my problem! (I also had to increase the z-index of the actual div so that the box would appear over the other background)