Imagine a scenario where I have a paragraph with various span elements that are styled using classes. What if there are numbers interspersed within the text for easy reference, and I want to ensure they do not end up at the end of a line?
For example:
1 This is some text that
wraps. 2 I don't want any
of these numbers 3 to end
up at the end of one of these
lines. For this example, 4
this number shouldn't be at
the end of the line.
Apologies if this explanation seems messy, but it's the best way I can convey my question. Each number is enclosed in its own span with a specific class. I am looking for a CSS solution to prevent them from being the last item on a line.
I initially thought about adjusting the margins of the number spans and the following text spans. However, I am seeking a more versatile solution that will work in all scenarios.
Thank you!