Possible Duplicate:
Post Overflow

Look at the comments for this question.


'Nuff said?

$('.comment-text div').attr('style', 'word-wrap: break-word; width: 650px')
  • If I'm not mistaken word-wrap did funky things in IE. quirksmode.org/oddsandends/wbr.html Apparently the "good guy" here is IE, the only one with that (except FF 3.1) blog.stchur.com/2007/02/22/… – perbert Mar 4 '10 at 2:17
  • comment text is in fact elastic, though -- there may or may not be UI there depending on whether you own the comment, # of upvotes (imagine 1000 upvotes on a comment), etc. And to my knowledge none of the fancy force-word-break things work for elastic layouts. – Jeff Atwood Apr 14 '10 at 7:05

Easy fix:

.comments {
    overflow: hidden;

alt text http://koper.wowpanda.net/socomments.PNG

  • Just applied that by Firebug and it didn't work.. – Earlz Mar 3 '10 at 23:47
  • Won't that just hide the horizontal scrollbar in the browser? – user102937 Mar 3 '10 at 23:49
  • @earlz: it does work for me. Are you sure you applied it to the correct element? @Robert: no it doesn't. It clips the extra text. – Thomas Bonini Mar 3 '10 at 23:51
  • I applied it to the <div> containing the comment(inside the <td>) – Earlz Mar 3 '10 at 23:53
  • What happens to word-wrap? – user102937 Mar 3 '10 at 23:53
  • oh nvm.. yea, applied the actual style rule and it works... except for with me it makes a scrollbar – Earlz Mar 3 '10 at 23:54
  • @Robert: nothing. All hidden does is to hide (clip) the text larger than the width of the element. If the text isn't a single word larger than the width of the element then it inserts a line break without clipping. – Thomas Bonini Mar 3 '10 at 23:55
  • @earlz: that's a rendering bug in Firefox that happens non deterministically when you change overflow on the fly. Try again and it won't show it. It will never show it if you put the rule in a .css file – Thomas Bonini Mar 3 '10 at 23:57
  • That might work, but what about for comments like @Robert Harvey's on the same page which didn't wrap either yet wasn't just one long word? – a_m0d Mar 3 '10 at 23:57
  • You should do overflow:auto instead of :hidden. That way the actual content isn't lost, and you can still ... enjoy ... it all. – user141160 Mar 4 '10 at 0:01
  • Case in point, the article linked to would hide the attribution to Robert Harvey in the comment under the offender if it were just hidden. – user141160 Mar 4 '10 at 0:04