Results 1 to 4 of 4

Thread: Break line on a long word

  1. #1
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default Break line on a long word

    Hi, I'm having this problem where if someone puts in a string, for example "dposdpaosdapsodapsdoaspdoasdldasldasdpaosdpodssapdosamx", just random text - but all in one word, it goes off the div and I don't want to use overflow:auto; because it looks ugly with a scroll bar.

    Here's some examples.

    Normal:

    normal.jpg

    No line break:

    nobreak.jpg

    Any way to get around this?

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    In some browsers: http://www.w3.org/TR/css3-text/#word-wrap

    Some browsers use "word-wrap" instead of "break-word", I think. At least, they used to.

  3. #3
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Well luckily I'm making this specifically for firefox, but it doesn't recognise "word-wrap" as a property, anything else I could try?

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Take a look at this thread: http://www.dynamicdrive.com/forums/showthread.php?t=38363
    Hope it helps.

Tags for this Thread

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
  •