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

Its <pre><code>foo</code></pre>.

All browsers will not automatically wrap text inside pre tags, since the text inside pre is supposed to have both width and line-breaks preserved. Scroll with two fingers inside the box to view whatever has been hidden by "overflow: scroll;". If you find a site that lets pre code snippets overflow into the right sidebar and off the screen, let them know their site is unusable and to add an overflow CSS rule to make it respect smaller screen widths.



You can also use white-space: pre-wrap to allow wrapping in preformatted text.




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

Search: