SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wrap long text in Firefox

    Hi I have very long text that I need to wrap, I have it fixed for IE using
    HTML Code:
    word-wrap: break-word;
    but it does not work for Firefox. Can anyone help me?

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unless there are white-space characters in the text, you can't. Astonishingly, Firefox still doesn't support soft hyphens (­ or ­).
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you would have to fix it using javascript for example, saying that after 20 characters you include a white space so it breaks to the next line?

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most likely, unless you have the option to do it server-side.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Soft hyphens (&shy) are supported in Firefox3, as is more 'whitespace' properties.

  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and is whitespace properties supported in Firefox 2?

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately, there's no white-space property value that allows a string to be broken other than at white-space characters (and explicit newlines).
    Birnam wood is come to Dunsinane

  8. #8
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, Thanks a lot for your help

  9. #9
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can anyone help me how to do this with javascript or server side with php?

  10. #10
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not in the CSS forum, no. You should post a new question in the appropriate forum.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •