I got a <p> element containing several <span> elements, and I am trying to add linebreaks at wherever the container wraps. However, it currently breaks on the spans.
Visual example:
Lorem Ipsum Dolor | Sit amet | conseceteuerblabla |
What I try to achieve:
Lorem Ipsum Dolor Si| t amet conseceteuerb| labla |
How can you achieve this preferably using the same markup?
My code:
p { font-family: monospace; font-size: calc(2em + 3vw); word-break: break-word; } span { word-break: break-word; } <p> <span>Lorem</span> <span>Ipsum</span> <span>Dolor</span> <span>Sit</span> <span>azerty</span> <span>qwerty</span> <span>asdfghjk</span> <span>qwertyuiopasdfghjkl</span> </p>
word-break: break-all