niiku23 Posted January 26, 2022 Share Posted January 26, 2022 Hi, Hoping somebody can help me with this please. Codepen is here. I would like the blue background colors to end at the end of each line width instead of stretching to the end of the container. Using max-width: max-content; works but not in i.e. I don't really need the words split but I am wondering if i need to loop through each line and find each end words position to set the width of the line. Surely there is a simple split text parameter to fix this? Many thanks! Nick See the Pen MWOWMBE by niiku23 (@niiku23) on CodePen Link to comment Share on other sites More sharing options...
Cassie Posted January 26, 2022 Share Posted January 26, 2022 Hi @niiku23, This is just down to your CSS (styling) not to do with GSAP. I think you're looking for display: inline-block? Good luck with your project! 1 Link to comment Share on other sites More sharing options...
niiku23 Posted January 26, 2022 Author Share Posted January 26, 2022 Hi, Thanks Cassie, inline-block doesn't do it unfortunately. I would like the blue to end on the actual line lengths. Link to comment Share on other sites More sharing options...
elegantseagulls Posted January 26, 2022 Share Posted January 26, 2022 49 minutes ago, niiku23 said: inline-block doesn't do it unfortunately. inline-block should do work. However, SplitText lines adds display block inline, so that it avoids certain issues. You may need to use !important in your css, or set it via gsap 1 Link to comment Share on other sites More sharing options...
Cassie Posted January 26, 2022 Share Posted January 26, 2022 Also you've put inline block on the container, You'll need to style the children - here's an option with !important as Ryan suggested. See the Pen NWwPqwJ by cassie-codes (@cassie-codes) on CodePen 1 Link to comment Share on other sites More sharing options...
niiku23 Posted January 26, 2022 Author Share Posted January 26, 2022 Amazing that is perfect. Thank you both! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now