I have a div
that has text-align: center
applied. It should be able to contain various text that may or may not wrap. When it wraps, I would like to have each line be roughly the same length, so it would show:
The quick brown fox jumps
over the lazy dog.
instead of:
The quick brown fox jumps over the lazy
dog.
Basically, I'm looking for a pure CSS way to automatically place the break near the center of the text.
I know there are JavaScript solutions, and I have currently implemented a server side solution, but I'm always trying to learn more CSS to make things more flexible in the future.
or change the width of the parent container. CSS cannot measure things, or make comparisons. I believe JS or server-side are your only options here. – Andrew Bacon Mar 26 '12 at 15:47