8

I was looking at an old post and when I expand the comments they spread way over everything on the right. Has anyone else experienced this problem?

I see it in Firefox 4.01, Chrome 11.0.696.68, and Opera 11.10 (on Mac).

7
  • What browser? It looks fine on IE8. Commented May 16, 2011 at 15:52
  • 2
    Certainly looks like a problem, I see it too (Firefox 3.6, Mac) Commented May 16, 2011 at 15:52
  • @Renesis , @mmyers am I posting this to the right place ? Commented May 16, 2011 at 15:54
  • This is a know bug. Jeff has stated many times that it is difficult to limit the width of comments because they have variable width. Commented May 16, 2011 at 16:03
  • @jjnguy but it wraps just fine until i open the additional comments Commented May 16, 2011 at 16:15
  • @mcg, that's because the comment that is causing the problem is hidden until you expand them. Commented May 16, 2011 at 16:19
  • @jjnguy right but that shouldn't matter see my answer Commented May 16, 2011 at 16:21

3 Answers 3

25

Yay! More unicode fun!

So far we were inserting soft-hyphens ­ into long comment lines without whitespace to force line-breaks; but it seems that not all browsers can be convinced to make this work in all cases.

We can't use the zero-width space ​ because it doesn't work in IE; we can't use the zero-width non-joiner ‌ because that doesn't work in all browser as well.

But alas: It seems the using both actually works everywhere. So, from now on, our Stack Exchange™ WhiteSpace EnforcementOfficer™ is

‌​

Next build, as usual.

11
  • ok I'm sure this is good logic to this but why not use what I suggested..please keep in mind that I am not a css expert Commented May 16, 2011 at 17:30
  • 2
    @mcgrailm See Jeff's answer here as to why CSS changes don't help in comments. Commented May 16, 2011 at 17:39
  • still don't get it, seems the answer is because hes not willing to make it fixed with or max-width seems like it's not a good reason but its not my site LOL Commented May 16, 2011 at 17:50
  • Did you consult with badp or are you putting him out of business? (; Commented May 16, 2011 at 20:25
  • 1
    @RebeccaChernoff: He's the Deputy. Which is good for him, because the Deputy is still alive. Commented May 16, 2011 at 20:45
  • Favoriting this answer for my own use in the future. Also, such a good answer maybe this should be migrated to SO; then again, it's probably a duplicate there :) Commented May 16, 2011 at 23:27
  • 1
    I guess you'll see it one day, but just in case you would not: what about inserting <span style="display: inline-block"></span> instead? Commented Mar 9, 2013 at 10:31
  • Instead of the often proposed word-wrap: break-word, there's also word-break: break-all, which works nicely in all my browsers, but apparently not in Opera... :-( Commented Mar 9, 2013 at 19:46
  • (@NickC, late response: if that future has come for you already, then maybe some other non-Unicode trickery is better, if your visitors are copying text. See my comments above. And of course all trickery might make it hard for search engines to index correctly.) Commented Nov 23, 2013 at 23:52
  • These characters are now inserted into comments even when there's enough whitespace. Is this normal or is it a bug? Commented Aug 18, 2016 at 10:00
  • @Szabolcs Marco is working on that code right now, I've pinged him. Commented Aug 18, 2016 at 10:54
2

I think this could be fixed with

.comment-text{
    max-width:50px;
}

no ?

edit

example image

it doesn't look like overflow is hidden here

4
  • So, you propose overflow: hidden? Commented May 16, 2011 at 16:23
  • @jjnguy see edit Commented May 16, 2011 at 16:36
  • why the down vote ? is this not a logical answer ? Commented May 16, 2011 at 18:09
  • dunno, it wasn't from me. Commented May 16, 2011 at 18:13
1

Using <wbr> tags instead of Unicode characters for breakpoints is likely to play better with copy-and-paste in current browsers (especially Firefox).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.