Closed dngraphisme closed 2 years ago
Nested elements are not fully compatible with splitting text into lines.
As a workaround, you could wrap each word in a <strong>
tag, instead of wrapping the entire sentence in a <strong>
tag. This will allow you to split the text into lines, and still maintain the original lines breaks.
Hello @lukePeavey,
Ok now I get it, I was thinking too. Gsap's SplitText has the same behavior. Too bad but it's already better than nothing.
Thank you very much for the quick response @lukePeavey :)
You're welcome.
I'm going to close this, but feel free to post a comment if you have any other questions
hello, @lukePeavey
It seems there's something wrong when I input this:
<p id="split">Lorem ipsum dolor sit amet, consectetur adipiscing elit. <strong>Nam in ante quis mi sollicitudin gravida eget congue tortor. Vivamus sit amet ipsum id sapien</strong> maximus hendrerit. Integer vehicula diam nec porta vulputate. Mauris sed metus varius, aliquam magna vitae, congue diam.</p>
But the text inside the <strong>
tag doesn't "split" as it should. Is there a solution?
Hello @lukePeavey ,
Thank you already for this little library ! Well seen the takeover of splitText from Gsap. Less heavy in addition to size :)
However, I have a question that I still can't manage regarding the split lines and the or or tags.
Here is my HTML code :
My JS code :
Anyway I always have a newline with the tag, I also don't understand the part you mention in nested-elements
See my screenshot : https://ibb.co/tz4v0KX
Am I doing something wrong ?
Thanks for your return :) Regards Nicolas