Force long line wrapping at some character

Discussion in 'HTML' started by Gnarlodious, Jan 27, 2005.

  1. Gnarlodious

    Gnarlodious Guest

    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?

    -- Gnarlie
    Gnarlodious, Jan 27, 2005
    #1
    1. Advertising

  2. Gnarlodious wrote:

    > Is there a way using CSS to force Firefox to wrap window-stretching lines?


    No.

    > 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/".


    Rewrite the script so it places a space before and after each slash.


    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Jan 28, 2005
    #2
    1. Advertising

  3. Gnarlodious <> wrote:

    > Is there a way using CSS to force


    No.

    > 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/".


    Fix the script. Why would you emit such a string?

    The slash is an ambiguous character and should seldom be used in normal
    text.

    > IE wraps the line at the slash character as if it were a space,


    If you really, really need to use (and I mean _really_) a long string with
    no whitespace, inserting <wbr> at suitable places (to allow a line break)
    is the practical solution. More on this and related stuff:
    http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Jan 28, 2005
    #3
  4. 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.

    HTH
    bernhard

    --
    www.daszeichen.ch
    remove nixspam to reply
    Bernhard Sturm, Jan 28, 2005
    #4
  5. 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.

    HTH
    bernhard

    --
    www.daszeichen.ch
    remove nixspam to reply
    Bernhard Sturm, Jan 28, 2005
    #5
  6. 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.

    HTH
    bernhard

    --
    www.daszeichen.ch
    remove nixspam to reply
    Bernhard Sturm, Jan 28, 2005
    #6
  7. Bernhard Sturm wrote:
    .... yes and his newsreader wrote it 3 times... sorry for that going to
    sleep now.

    --
    www.daszeichen.ch
    remove nixspam to reply
    Bernhard Sturm, Jan 28, 2005
    #7
  8. Bernhard Sturm wrote:
    .... yes and his newsreader wrote it 3 times... sorry for that, going to
    sleep now.

    --
    www.daszeichen.ch
    remove nixspam to reply
    Bernhard Sturm, Jan 28, 2005
    #8
  9. Gnarlodious

    Mark Parnell Guest

    Previously in alt.html, Bernhard Sturm <> said:

    > ... yes and his newsreader wrote it 3 times...


    And this one twice. :)

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Jan 28, 2005
    #9
  10. 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.

    --
    www.daszeichen.ch
    remove nixspam to reply
    Bernhard Sturm, Jan 28, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. danmc91
    Replies:
    3
    Views:
    558
    danmc91
    Oct 19, 2005
  2. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    645
    Eric Sosman
    Jul 8, 2003
  3. Replies:
    1
    Views:
    4,220
    Joe Kesselman
    Aug 2, 2006
  4. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,161
    Peter Shaggy Haywood
    Sep 20, 2005
  5. kaushikshome
    Replies:
    4
    Views:
    744
    kaushikshome
    Sep 10, 2006
Loading...

Share This Page