Force long line wrapping at some character

Is there a way using CSS to force Firefox to wrap window-stretching lines? I
want to avoid horizontal scrolling but a script returns a long line:
"blue/red/green/blue/yellow/magenta/cyan/gray/black/orange/dark
green/teal/tan/brown/violet/gold/dark blue/pink/lavender/".

IE wraps the line at the slash character as if it were a space, can I force
Firefox to do it too?

Gnarlodious wrote:
> Is there a way using CSS to force Firefox to wrap window-stretching lines? I
> want to avoid horizontal scrolling but a script returns a long line:
> "blue/red/green/blue/yellow/magenta/cyan/gray/black/orange/dark
> green/teal/tan/brown/violet/gold/dark blue/pink/lavender/".

not really... there is a css attribute called word-break, but this is IE
proprietary only, and you should avoid it.
If you want to know more about word-breaking issues, see:http://www.cs.tut.fi/~jkorpela/html/nobr.html
>
> IE wraps the line at the slash character as if it were a space, can I force
> Firefox to do it too?

you could define overflow:hidden; then it doesn't break up your design,
however, for obvious reason this is not the best solution. You could
also force your text to wrap with the PHP wordwrap(); function
(http://ch2.php.net/wordwrap), but this requires that your text is
either dynamically generated, or you have to parse your pages through a
PHP parser.

Gnarlodious wrote:
> Is there a way using CSS to force Firefox to wrap window-stretching lines? I
> want to avoid horizontal scrolling but a script returns a long line:
> "blue/red/green/blue/yellow/magenta/cyan/gray/black/orange/dark
> green/teal/tan/brown/violet/gold/dark blue/pink/lavender/".

not really... there is a css attribute called word-break, but this is IE
proprietary only, and you should avoid it.
If you want to know more about word-breaking issues, see:http://www.cs.tut.fi/~jkorpela/html/nobr.html
>
> IE wraps the line at the slash character as if it were a space, can I force
> Firefox to do it too?

you could define overflow:hidden; then it doesn't break up your design,
however, for obvious reason this is not the best solution. You could
also force your text to wrap with the PHP wordwrap(); function
(http://ch2.php.net/wordwrap), but this requires that your text is
either dynamically generated, or you have to parse your pages through a
PHP parser.

Gnarlodious wrote:
> Is there a way using CSS to force Firefox to wrap window-stretching lines? I
> want to avoid horizontal scrolling but a script returns a long line:
> "blue/red/green/blue/yellow/magenta/cyan/gray/black/orange/dark
> green/teal/tan/brown/violet/gold/dark blue/pink/lavender/".

not really... there is a css attribute called word-break, but this is IE
proprietary only, and you should avoid it.
If you want to know more about word-breaking issues, see:http://www.cs.tut.fi/~jkorpela/html/nobr.html
>
> IE wraps the line at the slash character as if it were a space, can I force
> Firefox to do it too?

you could define overflow:hidden; then it doesn't break up your design,
however, for obvious reason this is not the best solution. You could
also force your text to wrap with the PHP wordwrap(); function
(http://ch2.php.net/wordwrap), but this requires that your text is
either dynamically generated, or you have to parse your pages through a
PHP parser.

Mark Parnell wrote:
> Previously in alt.html, Bernhard Sturm <> said:
>
>
>>... yes and his newsreader wrote it 3 times...
>
>
> And this one twice.
>
arrrgghhh I just saw it this morning... so apologies for my cloning
experiments.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!