Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Whilst touching the CSS. Could it be considered to fix the code overflow on mobile?

    It is the effect of having a line which is longer than the viewport - so we end up having to scroll that specific line. Some might say it is better not to wrap code but I more often see this as part of a quote. I you really do not like to wrap the lines then I would prefer a scrollbar on the whole section. (I hope this line demos the issues).
I am not asking for mobile CSS. It is just on mobile it is most obvious.

My CSS knowledge is severely limited but I was thinking something along the lines of

    pre {
            overflow-x: auto;
            white-space: pre-wrap;
            white-space: -moz-pre-wrap;
            white-space: -pre-wrap;
            white-space: -o-pre-wrap;
            word-wrap: break-word;
     }
Others might have better ideas. Please chime in.

I salute the credo of moving slowly. And I hate to be a cry baby. I even hate the feature creep. But here I am :-}



Not sure it's feature creep to just make long lines friggin' readable. We can't seem to teach people not to use code blocks for quoting text, so either we need to "feature creep" a quote feature or we just fix this thing.


Yes please! The lines don't even need to wrap, but for some reason the <pre> blocks have `max-width: 200px` on small screens, making them infuriating to read on mobile.

Moving slow is good, but if every comment that uses it has a reply with the same thing that improves the formatting, something needs fixin'.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: