On Friday 25 August 2006 13:44, Andrew Poulos [ap*****@hotmail.com] wrote in
message <44**********************@per-qv1-newsreader-01.iinet.net.au>
Is there a way to know the overall width of a piece of text? Not the
width of, say, a single line P tag but any words it may contain.
I've been given a problem where text that is dynamically created is
supposed to be neatly wrapped in a styled DIV.
Do you have an example where the text isn't neatly wrapped? Unless you've
got very long words, a large text size and very little space there
shouldn't be a problem wrapping text.
The following CSS properties can be used for wrapping text.
text-align:left
should wrap text leaving the right 'ragged-right', this is usually the
default.
text-align:justify
should pad out the word spacing so that the left and right edges of the text
are all neatly aligned.
eg:
<p style="text-align:justify">Lorem Ipsum etc...</p>