What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

A bug was fixed earlier this year that caused long "words" with no breaks in them to spill over the side of the post. Jeff's response indicated that he didn't know how it could be fixed for comments.

Near as I can tell, there is no way to get this to work on comments because they are variable width. That is, the actual comment size depends on whether or not the comment vote UI controls are present (fex, on your own comment, you don't have controls, if you're not logged in there are no controls, etc), and if the comment has say 100 upvotes that's wider still.

While this is true, you can still make it look a damn sight better using the max-width style:

The above has only slight overspill when a comment in the same block has a triple-figure vote number, using the following CSS:

.comment-text > div { max-width:630px; word-wrap:break-word; }

It looks pretty much perfect when there are no votes, so the pixel amount could be tweaked to get the best overall result.

share|improve this question
    
Yes, I hate it when comments can either radically overflow their container or widen the entire page! (Not that I particularly like SE pages being fixed width, exactly, though it does at least keep the main text from becoming so wide that it becomes hard to read...) –  SamB May 25 '11 at 17:56

You must log in to answer this question.

Browse other questions tagged .